Skip to content

Commit

Permalink
Convert tests to ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
sirbrillig committed Sep 6, 2024
1 parent 57d3921 commit a624077
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions jest.config.js → jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tests/gitnews-fetcher.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
5 changes: 1 addition & 4 deletions tests/helpers.js
Original file line number Diff line number Diff line change
@@ -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 () {
Expand Down
4 changes: 2 additions & 2 deletions tests/reducer.js
Original file line number Diff line number Diff line change
@@ -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('');

Expand Down

0 comments on commit a624077

Please sign in to comment.