Skip to content

Commit 99db70b

Browse files
committed
imporved jest config and babel
1 parent edffb74 commit 99db70b

13 files changed

Lines changed: 28 additions & 22 deletions

File tree

babel.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ export default {
22
presets: [
33
['@babel/preset-env', { targets: { node: 'current' } }],
44
'@babel/preset-typescript',
5+
],
6+
plugins: [
57
'@babel/plugin-transform-runtime'
68
]
79
}

jest.config.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
module.exports = {
2-
verbose: true,
3-
// https://github.com/paralleldrive/cuid2/issues/44#issuecomment-1531731695
4-
testEnvironment: 'jsdom', // had to extend; see https://github.com/jsdom/jsdom/issues/2524
5-
testMatch: [
6-
'**/?(*.)+(spec|test).[tj]s?(x)'],
7-
setupFilesAfterEnv: [
8-
'./test/helpers/setup.ts'
9-
],
10-
transformIgnorePatterns: ['/node_modules/(?!lit-html).+\\.js'],
2+
verbose: true, // Uncomment for detailed test output
3+
collectCoverage: true,
4+
coverageDirectory: 'coverage',
5+
testEnvironment: 'jsdom',
116
testEnvironmentOptions: {
12-
customExportConditions: ['node']
13-
}
14-
7+
customExportConditions: ['node'],
8+
},
9+
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
10+
transform: {
11+
'^.+\\.[tj]sx?$': ['babel-jest', { configFile: './babel.config.js' }],
12+
},
13+
transformIgnorePatterns: ['/node_modules/(?!lit-html).+\\.js'],
14+
setupFilesAfterEnv: ['./test/helpers/setup.ts'],
15+
testMatch: ['**/?(*.)+(spec|test).[tj]s?(x)'],
16+
roots: ['<rootDir>/src', '<rootDir>/test', '<rootDir>/__mocks__'],
1517
}

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"coverage": "jest --coverage --collectCoverageFrom=src/**/*.[jt]s",
2222
"lint": "eslint",
2323
"lint-fix": "eslint --fix",
24-
"jest": "jest",
24+
"jest": "jest --no-coverage",
2525
"test:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --watch",
2626
"test": "npm run build-version && npm run lint && npm run jest",
2727
"doc": "typedoc --out ./Documentation/api/ ./src/ --excludeInternal",
@@ -88,6 +88,7 @@
8888
"@types/node": "^24.2.0",
8989
"@typescript-eslint/eslint-plugin": "^8.39.0",
9090
"@typescript-eslint/parser": "^8.39.0",
91+
"babel-jest": "^30.1.2",
9192
"babel-loader": "^10.0.0",
9293
"eslint": "^9.32.0",
9394
"eslint-import-resolver-typescript": "^4.4.4",

test/unit/__snapshots__/pad.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`notepad runs 1`] = `
44
<table

test/unit/__snapshots__/participation.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`manageParticipation runs 1`] = `
44
<table

test/unit/__snapshots__/tabs.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`tabWidget minimal setup of options renders content for first tab 1`] = `
44
<main
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`findBookmarkDocument complains if you have multiple bookmark docs 1`] = `"More than one bookmark file! <http://example.com/bookmarks2.ttl>,<http://example.com/bookmarks3.ttl>"`;

test/unit/footer/__snapshots__/index.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`createControllerInfoBlock makes use of options 1`] = `
44
<div

test/unit/header/__snapshots__/index.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`createBanner check customized logo... 1`] = `
44
<div

0 commit comments

Comments
 (0)