-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwallaby.conf.js
More file actions
67 lines (62 loc) · 2.43 KB
/
wallaby.conf.js
File metadata and controls
67 lines (62 loc) · 2.43 KB
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
62
63
64
65
66
67
// Copyright (c) Dolittle. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
module.exports = function (w) {
return {
files: [
{ pattern: 'package.json', instrument: false },
{ pattern: 'Source/*/package.json', instrument: false },
'!Distribution',
'!**/Distribution',
'Source/**/*.ts',
{ pattern: 'Source/**/for_*/**/given/*.@(ts|js)', instrument: false },
'!Source/**/for_*/**/!(given)/*.ts',
'!Source/**/for_*/*.ts',
],
tests: [
'!Distribution',
'!**/Distribution',
'Source/**/for_*/*.ts',
'Source/**/for_*/**/!(given)/*.ts',
'!Source/**/for_*/given/*.ts',
'!Source/**/for_*/**/given/*.ts',
],
env: {
type: 'node'
},
compilers: {
'**/*.ts': w.compilers.typeScript({
target: "ES2017",
module: "CommonJS",
downlevelIteration: true,
experimentalDecorators: true,
esModuleInterop: true,
})
},
setup: (w) => {
const rootFolder = w.projectCacheDir;
const getAliases = () => {
const { glob } = require('glob');
const aliases = {};
const rootPackage = require('./package.json');
rootPackage.workspaces.forEach(workspaceGlob => {
glob.sync(workspaceGlob).forEach(workspaceRoot => {
const relativeWorkspaceRoot = `./${workspaceRoot}`
const absoluteWorkspaceRoot = `${rootFolder}/${workspaceRoot}`;
const packageName = require(`${relativeWorkspaceRoot}/package.json`).name;
aliases[packageName] = absoluteWorkspaceRoot;
});
});
return aliases;
}
const { addAliases } = require('module-alias');
addAliases(getAliases());
global.expect = chai.expect;
const should = chai.should();
global.sinon = require('sinon');
const sinonChai = require('sinon-chai');
const chaiAsPromised = require('chai-as-promised');
chai.use(sinonChai);
chai.use(chaiAsPromised);
}
};
};