generated from Cipscis/base-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
29 lines (24 loc) · 902 Bytes
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/
/** @typedef {import('ts-jest').JestConfigWithTsJest} JestConfigWithTsJest */
/** @type {JestConfigWithTsJest} */
const config = {
// Don't inject globals. Require them to be imported from `@jest/globals`
injectGlobals: false,
// Specify where the tests are
rootDir: './src',
// Provide a mocked DOM environment for tests
testEnvironment: 'jsdom',
// Telling jsdom to use 'node' exports seems necessary to allow importing from Preact
testEnvironmentOptions: {
customExportConditions: ['node'],
},
// Allow tests to be written in TypeScript using ESM syntax
preset: 'ts-jest/presets/default-esm',
// Allow Jest's module resolution to find TypeScript files when imported as `.js`
resolver: 'ts-jest-resolver',
passWithNoTests: true,
};
export default config;