-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathjest.config.js
27 lines (27 loc) · 1.12 KB
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
module.exports = {
verbose: true,
testURL: 'http://localhost',
collectCoverage: true,
testMatch: ['**/unit/**/*.test.js', '**/*.test.js'],
moduleFileExtensions: ['js', 'json', 'vue'],
setupFiles: ['<rootDir>/.jest/register-context.js', 'jest-canvas-mock'],
setupFilesAfterEnv: ['<rootDir>/.jest/moment.js'],
transform: {
'^.+\\.mdx?$': '@storybook/addon-docs/jest-transform-mdx',
'^.+\\.stories\\.js|^.+\\.mdx?$': '@storybook/addon-storyshots/injectFileName',
'^.+\\.js$': '<rootDir>/node_modules/babel-jest',
'.*\\.(vue)$': 'vue-jest',
'^.+\\.md?$': 'markdown-loader-jest',
'^.+\\.html?$': 'html-loader-jest'
},
transformIgnorePatterns: [
'node_modules/(?!(@dpc-sdp*|ol|ol-ext|@storybook*)/)'
],
moduleNameMapper: {
// @TODO storybook storyshots fails with MDX.
// Add it to filemock until they fix it. https://github.com/storybookjs/storybook/issues/7223#issuecomment-506912633
'\\.(mdx|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|svg)$':
'<rootDir>/__mocks__/fileMock.js',
'\\.(css|scss)$': '<rootDir>/__mocks__/styleMock.js'
}
}