forked from 3scale/porta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
35 lines (35 loc) · 984 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
33
34
35
module.exports = {
roots: ['<rootDir>/spec/javascripts'],
moduleNameMapper: {
'c3': '<rootDir>/__mocks__/c3.js',
'\\.(css|less|sass|scss)$': '<rootDir>/spec/javascripts/__mocks__/styleMock.js',
'\\.(gif|ttf|eot)$': '<rootDir>/spec/javascripts/__mocks__/fileMock.js'
},
moduleFileExtensions: [
'jsx',
'js'
],
setupFiles: [
'<rootDir>/spec/javascripts/setupTests.js',
'<rootDir>/spec/javascripts/__mocks__/global-mocks.js'
],
snapshotSerializers: [
'enzyme-to-json/serializer'
],
moduleDirectories: [
'node_modules',
'app/javascript/src'
],
transform: {
'^.+\\.jsx?$': './node_modules/babel-jest',
// Png and svg imports fails in jest, workaround found in:
// https://github.com/facebook/jest/issues/2663#issuecomment-369040789
'.+\\.(png|svg)$': 'jest-transform-stub'
},
modulePathIgnorePatterns: [
'__snapshots__'
],
testURL: 'http://localhost',
testRegex: '.*.spec.jsx',
verbose: true
}