forked from carbon-design-system/carbon-for-ibm-dotcom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
57 lines (55 loc) · 1.5 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
* Copyright IBM Corp. 2020
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
module.exports = {
collectCoverageFrom: [
'packages/**/src/**/*.js',
'!packages/{bundler,cli,components,sketch}/**',
'!packages/**/{examples,stories}/**',
'!**/*-story.js',
],
moduleFileExtensions: ['js', 'json'],
reporters: ['default', 'jest-junit'],
setupFiles: ['./tasks/jest/setup.js'],
setupFilesAfterEnv: ['./tasks/jest/setupafter.js'],
snapshotSerializers: ['enzyme-to-json/serializer'],
testMatch: [
'<rootDir>/**/__tests__/**/*.test.js?(x)',
'<rootDir>/**/?(*.)(spec|test).js?(x)',
'<rootDir>/**/?(*-)(spec|test).js?(x)',
],
transform: {
'^.+\\.(js|jsx)$': './tasks/jest/jsTransform.js',
'^.+\\.template\\.(js|jsx)$': './tasks/jest/jsTransform.js',
'^.+\\.css$': './tasks/jest/cssTransform.js',
'^(?!.*\\.(js|jsx|css|json)$)': './tasks/jest/fileTransform.js',
},
testRunner: 'jest-circus/runner',
testPathIgnorePatterns: [
'/cjs/',
'/dist/',
'/es/',
'/lib/',
'e2e',
'examples',
'gulp-tasks',
'/umd/',
],
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$'],
watchPathIgnorePatterns: [
'/cjs/',
'/dist/',
'/es/',
'/examples/',
'/lib/',
'/storybook/',
],
collectCoverage: true,
coverageDirectory: 'coverage',
coverageReporters: ['text', 'html'],
testURL: 'http://localhost',
};