-
Notifications
You must be signed in to change notification settings - Fork 122
/
jest.config.js
32 lines (30 loc) · 918 Bytes
/
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
const path = require('path')
const ignorePatterns = [
'node_modules',
'__fixtures__',
'/packages/cli/lib',
'/packages/core/lib',
'/packages/init/lib',
'/packages/init/env',
'/packages/init/templates',
'/packages/craft/lib',
]
module.exports = {
rootDir: path.resolve(__dirname),
verbose: true,
testEnvironment: 'jsdom',
testURL: 'http://localhost/',
testPathIgnorePatterns: ignorePatterns,
coveragePathIgnorePatterns: ignorePatterns,
setupFiles: ['<rootDir>/testing/jest_setup.js'],
transform: {
'^.+\\.[jt]sx?$': 'babel-jest',
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/packages/core/src/$1', // TODO: "@/" prefix change
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/testing/file_mock.js',
'\\.(css|scss)$': '<rootDir>/testing/style_mock.js',
},
testMatch: ['**/__tests__/**/*.test.[j|t]s?(x)'],
}