-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathjest.config.js
35 lines (35 loc) · 1.03 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
/**
* Global setup
* @see https://jestjs.io/docs/en/configuration#globalsetup-string
*
* Configuration and setup from angularjs-jest
* @see https://github.com/dzikowski/angularjs-jest/tree/master/example
*
* @see https://github.com/jest-community/vscode-jest/issues/492
* @type {import('@jest/types/build/Config').ProjectConfig}
*/
const config = {
testEnvironment: 'jsdom',
collectCoverage: false,
coverageDirectory: './coverage',
collectCoverageFrom: [
'src/lib/**/*.js',
'!**/node_modules/**',
'!**/vendor/**',
],
// For css imports
moduleFileExtensions: ['js', 'html'],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/__mocks__/fileMock.js',
'^.+\\.(css|less|scss)$': 'babel-jest',
// '^.+\\.html?$': 'html-loader-jest',
},
modulePathIgnorePatterns: ['<rootDir>/dist'],
transform: {
'^.+\\.js$': 'babel-jest',
'^.+\\.html$': 'jest-raw-loader',
},
setupFiles: ['./src/setup-jest.js'],
}
module.exports = config