2020-05-18 19:49:10 +02:00
|
|
|
const path = require('path');
|
2018-11-08 16:12:19 +02:00
|
|
|
const config = require('../../jest.config');
|
|
|
|
|
2020-05-18 20:38:45 +02:00
|
|
|
const projectDir = path.join(__dirname, '../../');
|
2020-05-18 19:49:10 +02:00
|
|
|
|
2018-11-08 16:12:19 +02:00
|
|
|
module.exports = {
|
2019-04-25 22:54:53 +02:00
|
|
|
preset: 'jest-preset-angular',
|
2018-11-08 16:12:19 +02:00
|
|
|
globals: {
|
2020-01-31 22:39:38 +01:00
|
|
|
'ts-jest': {
|
2020-05-18 20:38:45 +02:00
|
|
|
tsConfig: path.join(__dirname, 'src/tsconfig.spec.json'),
|
2020-05-15 08:19:07 +12:00
|
|
|
stringifyContentPathRegex: '\\.html$',
|
2020-01-31 22:39:38 +01:00
|
|
|
},
|
2018-11-08 16:12:19 +02:00
|
|
|
},
|
|
|
|
roots: [__dirname],
|
|
|
|
transform: {
|
2019-10-18 09:07:36 +08:00
|
|
|
'^.+\\.stories\\.[jt]sx?$': '@storybook/addon-storyshots/injectFileName',
|
2020-05-18 19:49:10 +02:00
|
|
|
'^.+\\.(ts|html)$': 'ts-jest',
|
|
|
|
'^.+\\.jsx?$': path.join(projectDir, 'scripts/utils/jest-transform-js.js'),
|
2019-10-24 20:39:36 +08:00
|
|
|
'^.+\\.mdx$': '@storybook/addon-docs/jest-transform-mdx',
|
2018-11-08 16:12:19 +02:00
|
|
|
},
|
2018-12-16 12:12:26 +02:00
|
|
|
moduleFileExtensions: [...config.moduleFileExtensions, 'html'],
|
2020-05-15 08:19:07 +12:00
|
|
|
snapshotSerializers: [
|
|
|
|
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
|
|
|
|
'jest-preset-angular/build/AngularSnapshotSerializer.js',
|
|
|
|
'jest-preset-angular/build/HTMLCommentSerializer.js',
|
|
|
|
],
|
2020-05-18 19:49:10 +02:00
|
|
|
setupFilesAfterEnv: ['./jest-config/setup.ts'],
|
2018-11-08 16:12:19 +02:00
|
|
|
};
|