chore: 🤖 Updating jest configuration

Included types for jest-extended and exceptions for es module tests
This commit is contained in:
Justin Dalrymple 2020-02-01 10:25:04 +01:00
parent ff9e7878ec
commit ca9b66f096
3 changed files with 27 additions and 20 deletions

1
global.d.ts vendored Normal file
View File

@ -0,0 +1 @@
import 'jest-extended';

26
jest.config.js Normal file
View File

@ -0,0 +1,26 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testRegex: 'test\\/.*\\.ts$',
testMatch: null,
testURL: 'http://localhost/',
testTimeout: 15000,
coverageDirectory: 'coverage',
collectCoverage: true,
setupFilesAfterEnv: ['jest-extended'],
moduleNameMapper: {
'^ky$': require.resolve('ky').replace('index.js', 'umd.js'),
},
globals: {
'ts-jest': {
diagnostics: {
ignoreCodes: [2339],
},
},
},
};

View File

@ -1,20 +0,0 @@
{
"preset": "ts-jest",
"testEnvironment": "node",
"testRegex": "test\\/.*\\.ts$",
"testMatch": null,
"testURL": "http://localhost/",
"coverageDirectory": "./coverage/",
"setupFilesAfterEnv": ["jest-extended"],
"globals": {
"ts-jest": {
"diagnostics": {
"ignoreCodes": [2339]
}
}
}
}