2017-05-18 17:57:07 +01:00
|
|
|
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',
|
2017-05-18 17:57:07 +01:00
|
|
|
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',
|
2017-05-18 17:57:07 +01:00
|
|
|
'\\.(css|scss)$': '<rootDir>/__mocks__/styleMock.js',
|
2017-11-13 23:06:01 -05:00
|
|
|
'\\.(md)$': '<rootDir>/__mocks__/htmlMock.js',
|
2018-08-30 17:16:21 +02:00
|
|
|
'^riot$': 'riot/riot',
|
2017-05-18 17:57:07 +01:00
|
|
|
},
|
2017-06-08 00:22:19 +02:00
|
|
|
roots: [
|
|
|
|
'<rootDir>/addons',
|
|
|
|
'<rootDir>/app',
|
|
|
|
'<rootDir>/lib',
|
2017-06-15 15:09:08 +10:00
|
|
|
'<rootDir>/examples/cra-kitchen-sink',
|
2018-01-02 00:13:34 +02:00
|
|
|
'<rootDir>/examples/vue-kitchen-sink',
|
2018-06-17 20:28:31 +02:00
|
|
|
'<rootDir>/examples/svelte-kitchen-sink',
|
2018-08-27 19:42:20 +02:00
|
|
|
'<rootDir>/examples/riot-kitchen-sink',
|
2018-04-24 16:34:15 +03:00
|
|
|
'<rootDir>/examples/html-kitchen-sink',
|
2017-12-21 13:55:15 +11:00
|
|
|
'<rootDir>/examples/official-storybook',
|
2018-09-30 15:06:09 -07:00
|
|
|
'<rootDir>/examples/ember-cli',
|
2017-12-26 16:32:18 +02:00
|
|
|
'<rootDir>/examples/angular-cli',
|
2017-06-08 00:22:19 +02:00
|
|
|
],
|
2018-09-20 11:16:53 +02:00
|
|
|
snapshotSerializers: ['@emotion/snapshot-serializer'],
|
2017-12-26 16:32:18 +02:00
|
|
|
transform: {
|
2018-08-15 17:26:24 +03:00
|
|
|
'^.+\\.jsx?$': '<rootDir>/scripts/babel-jest.js',
|
2018-07-24 01:38:21 +03:00
|
|
|
'^.+[/\\\\].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',
|
2018-06-17 20:28:31 +02:00
|
|
|
'.*\\.(svelte)$': '<rootDir>/node_modules/svelte-jest',
|
2018-08-27 19:42:20 +02:00
|
|
|
'^.+\\.(tag)$': '<rootDir>/node_modules/riot-jest-transformer',
|
2018-08-28 08:03:50 +02:00
|
|
|
'^.+\\.(txt)$': '<rootDir>/node_modules/jest-raw-loader',
|
2017-12-26 16:32:18 +02:00
|
|
|
},
|
2018-07-05 21:22:42 +03:00
|
|
|
testPathIgnorePatterns: ['/node_modules/', '/dist/', 'addon-jest.test.js', '/cli/test/'],
|
2017-05-18 17:57:07 +01:00
|
|
|
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/**',
|
|
|
|
],
|
2017-05-18 17:57:07 +01:00
|
|
|
coverageDirectory: 'coverage',
|
|
|
|
testEnvironment: 'jsdom',
|
2017-09-28 14:25:49 +02:00
|
|
|
setupTestFrameworkScriptFile: './scripts/jest.init.js',
|
|
|
|
setupFiles: ['raf/polyfill'],
|
2017-12-23 00:57:53 +01:00
|
|
|
testURL: 'http://localhost',
|
2018-08-27 19:42:20 +02:00
|
|
|
moduleFileExtensions: [
|
|
|
|
'ts',
|
|
|
|
'tsx',
|
|
|
|
'js',
|
|
|
|
'jsx',
|
|
|
|
'json',
|
|
|
|
'node',
|
|
|
|
'.html',
|
|
|
|
'.svelte',
|
|
|
|
'vue',
|
|
|
|
'tag',
|
|
|
|
],
|
2017-05-18 17:57:07 +01:00
|
|
|
};
|