-
Notifications
You must be signed in to change notification settings - Fork 3
/
wallaby.js
38 lines (29 loc) · 943 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
module.exports = (wallaby) => {
process.env.VUE_CLI_BABEL_TRANSPILE_MODULES = true
const compiler = wallaby.compilers.babel({ presets: [['@vue/app', { modules: 'commonjs' }]] })
return {
files: ['src/**/*', 'jest.config.js', 'package.json', '!src/**/*.spec.js'],
tests: ['src/**/*.spec.js'],
env: {
type: 'node',
runner: 'node'
},
compilers: {
'**/*.js': compiler,
'**/*.vue': require('wallaby-vue-compiler')(compiler)
},
preprocessors: {
'**/*.vue': file => require('vue-jest').process(file.content, file.path)
},
testFramework: 'jest',
setup: function (wallaby) {
const jestConfig = require('./package').jest || require('./jest.config')
jestConfig.transform = {}
jestConfig.moduleNameMapper = {
'^@/(.*)$': wallaby.projectCacheDir + '/src/$1'
}
wallaby.testFramework.configure(jestConfig)
},
debug: true
}
}