forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.preset.js
29 lines (24 loc) · 893 Bytes
/
jest.preset.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
// @ts-check
const path = require('path');
const { pathsToModuleNameMapper } = require('ts-jest');
const tsConfig = require('./tsconfig.base.json');
const tsPathAliases = pathsToModuleNameMapper(tsConfig.compilerOptions.paths, {
prefix: `<rootDir>/${path.relative(process.cwd(), __dirname)}/`,
});
/**
* @type {import('@jest/types').Config.InitialOptions}
*/
const baseConfig = {
transform: {
'^.+\\.ts$': 'ts-jest',
},
testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
testPathIgnorePatterns: ['/node_modules/', '/lib/', '/lib-commonjs/', '/dist/'],
testEnvironment: 'jsdom',
moduleNameMapper: { ...tsPathAliases },
cacheDirectory: '<rootDir>/node_modules/.cache/jest',
clearMocks: true,
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
};
module.exports = { ...baseConfig };