Skip to content

Commit 2a09f0c

Browse files
committed
Configure jest to use tsconfig.json
1 parent 23062f1 commit 2a09f0c

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

jest.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
module.exports = {
2+
preset: "ts-jest",
3+
setupFiles: [
4+
'core-js'
5+
],
26
roots: [
37
'<rootDir>/bin',
48
'<rootDir>/src',
@@ -12,4 +16,9 @@ module.exports = {
1216
transform: {
1317
'^.+\\.(ts|tsx)?$': 'ts-jest'
1418
},
19+
globals: {
20+
'ts-jest': {
21+
tsConfig: 'tsconfig.json',
22+
}
23+
}
1524
}

package-lock.json

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

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
},
1212
"scripts": {
1313
"prepublishOnly": "npm run ci",
14-
"ci": "DEBUG_MODE=none jest --ci && npm run build",
14+
"ci": "DEBUG_MODE=none npm run build && jest --ci",
1515
"build": "rimraf dist && rollup -c",
16-
"test:watch": "jest --watch",
17-
"test": "jest --verbose"
16+
"test:watch": "npm run build && jest --watch",
17+
"test": "npm run build && jest --verbose"
1818
},
1919
"files": [
2020
"dist",
@@ -35,6 +35,7 @@
3535
"@types/jest": "^24.0.25",
3636
"@typescript-eslint/eslint-plugin": "^2.15.0",
3737
"@typescript-eslint/parser": "^2.15.0",
38+
"core-js": "^3.6.4",
3839
"eslint": "^6.8.0",
3940
"glob": "^7.1.6",
4041
"jest": "^24.9.0",

tests/dynamic-tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const writeOutput = process.env['DEBUG_MODE'] !== 'none';
1616

1717
const folders = ['test-data/**/*input.ts', 'test-data/**/*input.d.ts', 'test-data/**/*exact.d.ts']
1818
.map(f => glob.sync(f, { cwd: __dirname }))
19-
.reduce((allFiles, files) => [...allFiles, ...files], [])
19+
.flat()
2020
.map(f => [f]);
2121

2222
function createApplication(logOutput: string[]) {

0 commit comments

Comments
 (0)