-
Notifications
You must be signed in to change notification settings - Fork 6
/
wallaby.js
44 lines (35 loc) · 1.25 KB
/
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
42
43
44
module.exports = (wallaby) => {
// Babel, jest-cli and some other modules are located under
// react-scripts/node_modules, so need to let node.js know about it
const path = require('path')
process.env.NODE_PATH += `${path.delimiter}${path.join(wallaby.localProjectDir, 'client-site', 'node_modules')}${path.delimiter}${path.join(wallaby.localProjectDir, 'server', 'node_modules')}`
require('module').Module._initPaths()
// Babel needs this
process.env.NODE_ENV = 'test'
return {
files: [
{ pattern: 'src/**/*.js', load: false },
{ pattern: 'package.json', load: false },
{ pattern: '__tests__/**/*.snap', load: false },
{ pattern: '__test-helpers__/**/*.js', load: false },
{ pattern: '__test-helpers__/**/*.css', load: false, instrument: false },
],
filesWithNoCoverageCalculated: [
'__test-helpers__/**/*.js',
],
tests: ['__tests__/**/*.js'],
env: {
type: 'node',
runner: 'node',
},
testFramework: 'jest',
compilers: {
'**/*.js': wallaby.compilers.babel({ babelrc: true, presets: ['babel-preset-jest'] }),
},
setup(wallaby) {
const conf = require('./package.json').jest
wallaby.testFramework.configure(conf)
},
debug: true,
}
}