From ca9b66f096798d7469acfc2230a1f2fb3522b6bb Mon Sep 17 00:00:00 2001 From: Justin Dalrymple Date: Sat, 1 Feb 2020 10:25:04 +0100 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Updating=20jest=20confi?= =?UTF-8?q?guration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Included types for jest-extended and exceptions for es module tests --- global.d.ts | 1 + jest.config.js | 26 ++++++++++++++++++++++++++ jest.config.json | 20 -------------------- 3 files changed, 27 insertions(+), 20 deletions(-) create mode 100644 global.d.ts create mode 100644 jest.config.js delete mode 100644 jest.config.json diff --git a/global.d.ts b/global.d.ts new file mode 100644 index 00000000..9e6c1dbd --- /dev/null +++ b/global.d.ts @@ -0,0 +1 @@ +import 'jest-extended'; diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 00000000..ae1c852d --- /dev/null +++ b/jest.config.js @@ -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], + }, + }, + }, +}; diff --git a/jest.config.json b/jest.config.json deleted file mode 100644 index 0fedac97..00000000 --- a/jest.config.json +++ /dev/null @@ -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] - } - } - } -}