-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
31 lines (26 loc) · 1 KB
/
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
30
31
/**
* 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: '../app',
// Tell Jest how to follow module resolution rules based on tsconfig's baseUrl
moduleDirectories: ['node_modules', './app/assets/js/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'],
},
// Run a setup script before all test suites
setupFilesAfterEnv: ['../test/jest.setup.ts'],
// Allow tests to be written in TypeScript using ESM syntax
preset: 'ts-jest/presets/default-esm',
passWithNoTests: true,
};
export default config;