storybook/jest.config.js

48 lines
1.6 KiB
JavaScript
Raw Normal View History

module.exports = {
2017-12-29 16:26:51 +02:00
globals: {
__TRANSFORM_HTML__: true,
},
2017-12-23 21:12:27 +01:00
cacheDirectory: '.cache/jest',
clearMocks: true,
moduleNameMapper: {
2017-06-05 00:58:23 +02:00
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/__mocks__/fileMock.js',
'\\.(css|scss)$': '<rootDir>/__mocks__/styleMock.js',
'\\.(md)$': '<rootDir>/__mocks__/htmlMock.js',
},
roots: [
'<rootDir>/addons',
'<rootDir>/app',
'<rootDir>/lib',
'<rootDir>/examples/cra-kitchen-sink',
2018-01-02 00:13:34 +02:00
'<rootDir>/examples/vue-kitchen-sink',
'<rootDir>/examples/svelte-kitchen-sink',
2018-04-24 16:34:15 +03:00
'<rootDir>/examples/html-kitchen-sink',
'<rootDir>/examples/official-storybook',
'<rootDir>/examples/angular-cli',
],
transform: {
2018-07-05 20:35:00 +03:00
'^.+\\.jsx?$': './babel-jest',
'^.+[/\\\\].storybook[/\\\\]config\\.ts$': '<rootDir>/scripts/jest-ts-babel.js',
2017-12-29 16:26:51 +02:00
'^.+\\.(ts|html)$': '<rootDir>/node_modules/jest-preset-angular/preprocessor.js',
2018-01-02 00:13:34 +02:00
'.*\\.(vue)$': '<rootDir>/node_modules/jest-vue-preprocessor',
'.*\\.(svelte)$': '<rootDir>/node_modules/svelte-jest',
},
2018-07-05 21:22:42 +03:00
testPathIgnorePatterns: ['/node_modules/', '/dist/', 'addon-jest.test.js', '/cli/test/'],
collectCoverage: false,
2017-05-23 20:56:54 +02:00
collectCoverageFrom: [
'app/**/*.{js,jsx}',
'lib/**/*.{js,jsx}',
'addons/**/*.{js,jsx}',
2017-11-11 14:28:47 +03:00
'!**/cli/test/**',
2018-05-11 22:27:44 +02:00
'!**/dist/**',
2017-05-23 20:56:54 +02:00
'!**/generators/**',
],
coverageDirectory: 'coverage',
testEnvironment: 'jsdom',
setupTestFrameworkScriptFile: './scripts/jest.init.js',
setupFiles: ['raf/polyfill'],
testURL: 'http://localhost',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node', '.html', '.svelte', 'vue'],
};