-
Notifications
You must be signed in to change notification settings - Fork 2
/
wallaby.conf.js
61 lines (54 loc) · 1.89 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
const webpackConfig = require('./webpack.config')('test');
const wallabyWebpack = require('wallaby-webpack');
// https://wallabyjs.com/docs/integration/webpack.html
module.exports = function (wallaby) {
delete webpackConfig.devServer;
delete webpackConfig.entry;
// json only needed for brittleness in Chai, remove when fixed
webpackConfig.resolve.extensions = ['.js', '.ts', '.vue', '.json'];
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.alias = {'@': require('path').join(wallaby.projectCacheDir, 'app')};
// webpackConfig.externals = {vue: 'Vue'};
const wallabyPostprocessor = wallabyWebpack(webpackConfig);
return {
compilers: {
'**/*.js': wallaby.compilers.babel(),
'**/*.ts': wallaby.compilers.typeScript(),
'**/*.vue': require('wallaby-vue-compiler')(wallaby.compilers.babel())
},
debug: true,
env: {
type: 'browser' // browser or node
// runner: 'node',
},
files: [
{pattern: '.babelrc', load: false, instrument: false},
{pattern: 'tsconfig.json', load: false, instrument: false},
{pattern: 'node_modules/vue/dist/vue.js', instrument: false},
{pattern: 'app/**/*.ts', load: false},
{pattern: 'app/**/*.vue', load: false},
],
hints: {
ignoreCoverage: /ignore coverage/
},
preprocessors: {
'**/*.js': file => require('babel-core').transform(
file.content,
{sourceMap: true, compact: false, filename: file.path, babelrc: true})
},
postprocessor: wallabyPostprocessor,
setup: function () {
// window.expect = chai.expect;
// eslint-disable-next-line
Vue.config.errorHandler = function (err) {
throw err;
};
window.__moduleBundler.loadTests();
},
testFramework: 'mocha',
tests: [
{pattern: 'test/**/*.test.ts', load: false}
]
};
};