diff --git a/jest.config.js b/jest.config.cjs similarity index 99% rename from jest.config.js rename to jest.config.cjs index 421601a..55deb0f 100644 --- a/jest.config.js +++ b/jest.config.cjs @@ -175,6 +175,7 @@ module.exports = { // A map from regular expressions to paths to transformers // transform: undefined, + transform: {}, // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation // transformIgnorePatterns: [ diff --git a/package.json b/package.json index a76cf26..f3e74a0 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "GitHub notifications in your menu bar", "productName": "Gitnews", "type": "module", - "exports": "./src/main/index.js", + "main": "./.webpack/main", "scripts": { "start": "electron-forge start", "dist-clean": "rm -rf dist && rm -rf node_modules", diff --git a/tests/gitnews-fetcher.js b/tests/gitnews-fetcher.js index d6390fe..663a7ed 100644 --- a/tests/gitnews-fetcher.js +++ b/tests/gitnews-fetcher.js @@ -1,5 +1,5 @@ /* globals describe, it */ -const { getErrorHandler } = require('../src/renderer/lib/gitnews-fetcher'); +import { getErrorHandler } from '../src/renderer/lib/gitnews-fetcher'; window.electronApi = { quitApp: () => undefined, diff --git a/tests/helpers.js b/tests/helpers.js index 3d7ddb2..a4ea9a0 100644 --- a/tests/helpers.js +++ b/tests/helpers.js @@ -1,8 +1,5 @@ /* globals describe, it */ -const { - getErrorMessage, - isOfflineCode, -} = require('../src/renderer/lib/helpers'); +import { getErrorMessage, isOfflineCode } from '../src/renderer/lib/helpers'; describe('getErrorMessage()', function () { it('returns the error if the error is a string', function () { diff --git a/tests/reducer.js b/tests/reducer.js index c206dc8..fab40c8 100644 --- a/tests/reducer.js +++ b/tests/reducer.js @@ -1,6 +1,6 @@ /* globals describe, it, beforeEach */ -const { createReducer } = require('../src/renderer/lib/reducer'); -const { secsToMs } = require('../src/renderer/lib/helpers'); +import { createReducer } from '../src/renderer/lib/reducer'; +import { secsToMs } from '../src/renderer/lib/helpers'; const reducer = createReducer('');