-
Notifications
You must be signed in to change notification settings - Fork 11
/
wallaby.js
41 lines (35 loc) · 950 Bytes
/
wallaby.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
process.env.BABEL_ENV = 'test';
process.env.NODE_ENV = 'test';
const babelCompilerOptions = {
presets: ['react-app', 'flow'],
plugins: ['inline-react-svg', 'flow-react-proptypes', 'jsx-control-statements'],
};
module.exports = function (wallaby) {
return {
files: [
'src/**/*.js',
'!src/**/*test.js',
],
tests: [
'src/**/*test.js',
],
env: {
type: 'node',
runner: 'node',
params: {
runner: '--harmony',
},
},
compilers: {
'**/*.js': wallaby.compilers.babel(babelCompilerOptions),
},
testFramework: 'jest',
setup (wallaby) {
const jestConfig = require('./package.json').jest;
jestConfig.moduleNameMapper = {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': `${wallaby.localProjectDir}/__mocks__/file-mock.js`,
};
wallaby.testFramework.configure(jestConfig);
},
};
};