1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | const path = require('path');
|
7 | const testingDir = __dirname;
|
8 | const rootDir = path.join(testingDir, '..');
|
9 | const internalDir = path.join(rootDir, 'internal');
|
10 |
|
11 |
|
12 | const moduleExtensions = ['ts', 'tsx', 'js', 'mjs', 'jsx'];
|
13 | const moduleExtensionRegexp = '(' + moduleExtensions.join('|') + ')';
|
14 |
|
15 | module.exports = {
|
16 | moduleFileExtensions: [...moduleExtensions, 'json', 'd.ts'],
|
17 | moduleNameMapper: {
|
18 | '^@stencil/core/cli$': path.join(rootDir, 'cli', 'index.js'),
|
19 | '^@stencil/core/compiler$': path.join(rootDir, 'compiler', 'stencil.js'),
|
20 | '^@stencil/core/internal$': path.join(internalDir, 'testing', 'index.js'),
|
21 | '^@stencil/core/internal/app-data$': path.join(internalDir, 'app-data', 'index.cjs'),
|
22 | '^@stencil/core/internal/app-globals$': path.join(internalDir, 'app-globals', 'index.js'),
|
23 | '^@stencil/core/internal/testing$': path.join(internalDir, 'testing', 'index.js'),
|
24 | '^@stencil/core/mock-doc$': path.join(rootDir, 'mock-doc', 'index.cjs'),
|
25 | '^@stencil/core/sys$': path.join(rootDir, 'sys', 'node', 'index.js'),
|
26 | '^@stencil/core/testing$': path.join(testingDir, 'index.js'),
|
27 | '^@stencil/core$': path.join(internalDir, 'testing', 'index.js'),
|
28 | },
|
29 | setupFilesAfterEnv: [path.join(testingDir, 'jest-setuptestframework.js')],
|
30 | testEnvironment: path.join(testingDir, 'jest-environment.js'),
|
31 | testPathIgnorePatterns: ['/.cache', '/.stencil', '/.vscode', '/dist', '/node_modules', '/www'],
|
32 | testRegex: '(/__tests__/.*|\\.?(test|spec))\\.' + moduleExtensionRegexp + '$',
|
33 | transform: {
|
34 | '^.+\\.(ts|tsx|jsx|css)$': path.join(testingDir, 'jest-preprocessor.js'),
|
35 | },
|
36 | watchPathIgnorePatterns: ['^.+\\.d\\.ts$'],
|
37 | };
|