forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.preset.js
28 lines (23 loc) · 834 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
// @ts-check
const path = require('path');
const { pathsToModuleNameMapper } = require('ts-jest/utils');
const tsConfig = require('./tsconfig.base.json');
const tsPathAliases = pathsToModuleNameMapper(tsConfig.compilerOptions.paths, {
prefix: `<rootDir>/${path.relative(process.cwd(), __dirname)}/`,
});
/**
* @type {jest.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/'],
moduleNameMapper: { ...tsPathAliases },
cacheDirectory: '<rootDir>/.cache/jest',
clearMocks: true,
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
};
module.exports = { ...baseConfig };