-
Notifications
You must be signed in to change notification settings - Fork 1
/
wallaby.conf.js
41 lines (34 loc) · 1.26 KB
/
wallaby.conf.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
const wallabyWebpack = require('wallaby-webpack')
var webpackConfig = require('./webpack.test.js')
module.exports = function (wallaby) {
webpackConfig.module.rules = webpackConfig.module.rules.filter(r => !'.ts'.match(r.test) && !'.js'.match(r.test));
webpackConfig.module.rules.find(r => r.loader === 'vue-loader').options.loaders.js = '';
webpackConfig.resolve.extensions = ['.js', '.ts', '.vue', '.json'];
const wallabyPostprocessor = wallabyWebpack(webpackConfig)
return {
files: [
{pattern: 'node_modules/chai/chai.js', instrument: false},
{pattern: 'node_modules/sinon/pkg/sinon.js', instrument: false},
{pattern: 'src/**/*.*', load: false},
{ pattern: 'src/**/*.spec.ts', ignore: true }
],
compilers: {
'**/*.ts': wallaby.compilers.typeScript({module: 'es2015', target: 'ES5'})
},
preprocessors: {
'**/*.vue': f => f.content.replace('lang="ts"', '').replace('.ts', '.js')
},
tests: [
{pattern: 'src/**/*.spec.ts', load: false},
],
postprocessor: wallabyPostprocessor,
testFramework: 'mocha',
setup: function () {
window.__moduleBundler.loadTests()
window.expect = chai.expect
window.sinon = sinon
var should = chai.should()
},
debug: true
}
}