1 | const babelJest = require('babel-jest');
|
2 | const babelServerRule = require('./src/webpack/inc/babel-server-rule')({
|
3 | cacheDirectory: false,
|
4 | noChunk: true,
|
5 | }).use.options;
|
6 |
|
7 | const customJest = babelJest.createTransformer({
|
8 | presets: babelServerRule.presets,
|
9 | plugins: babelServerRule.plugins,
|
10 | });
|
11 | customJest.includes = query => query === 'babel-jest';
|
12 |
|
13 | module.exports = {
|
14 | name: 'pawjs',
|
15 | verbose: true,
|
16 | testEnvironment: 'node',
|
17 | coverageDirectory: './coverage',
|
18 | collectCoverage: true,
|
19 | collectCoverageFrom: [
|
20 | 'src/**/*.{js,jsx,ts,tsx}',
|
21 | '!**/node_modules/**',
|
22 | '!**/dist/**',
|
23 | ],
|
24 | testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(ts|tsx|js|jsx|mjs)?$',
|
25 | testPathIgnorePatterns: [
|
26 | '/node_modules/',
|
27 | '/__test_utils/',
|
28 | '__tests__/.*/fixtures/',
|
29 | ],
|
30 | moduleFileExtensions: [
|
31 | 'ts',
|
32 | 'tsx',
|
33 | 'js',
|
34 | 'jsx',
|
35 | 'json',
|
36 | 'node',
|
37 | ],
|
38 | transform: {
|
39 | '^.+\\.(j|t)sx?$': '<rootDir>/jest-transformer.js',
|
40 | },
|
41 | };
|