storybook/examples/angular-cli/jest.config.js
2019-10-18 09:07:36 +08:00

19 lines
647 B
JavaScript

const config = require('../../jest.config');
module.exports = {
preset: 'jest-preset-angular',
...config,
globals: {
__TRANSFORM_HTML__: true,
},
roots: [__dirname],
transform: {
'^.+\\.stories\\.[jt]sx?$': '@storybook/addon-storyshots/injectFileName',
'^.+\\.jsx?$': '<rootDir>/scripts/babel-jest.js',
'^.+[/\\\\].storybook[/\\\\]config\\.ts$': '<rootDir>/scripts/jest-ts-babel.js',
'^.+\\.html$': '<rootDir>/node_modules/jest-preset-angular/preprocessor.js',
'^.+\\.ts$': '<rootDir>/node_modules/jest-preset-angular/preprocessor.js',
},
moduleFileExtensions: [...config.moduleFileExtensions, 'html'],
};