-
Notifications
You must be signed in to change notification settings - Fork 5
/
ava.config.js
50 lines (49 loc) · 1.32 KB
/
ava.config.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
console.log(process.env.TYPESCRIPT);
console.log(process.env.DEBUG);
const ts = typeof process.env.TYPESCRIPT !== "undefined";
console.log(`TypeScript: ` + ts);
const conf = {
"files": [
`${ts ? "./test/**/test*.ts" : "./dist/es8-es2017/test/**/test*.js"}`,
`${ts ? "./test/**/helpers*.ts" : "!./dist/es8-es2017/test/**/helpers*.js"}`,
`${ts ? "!./test/**/@types" : "!./dist/es8-es2017/test/**/@types"}`
],
"helpers": [
`${ts ? "./test/**/helpers*.ts" : "!./dist/es8-es2017/test/**/helpers*.js"}`,
],
"sources": [
"./src/**/*"
],
"match": [
"*"
],
"cache": false,
"concurrency": 1,
"failWithoutAssertions": false,
"babel": false,
"compileEnhancements": false,
"verbose": true,
"fail-fast": true,
"failFast": true,
"color": true,
"serial": true,
"no-cache": false,
"noCache": false,
"extensions": [
"js",
"ts"
]
};
if (ts) {
conf.environmentVariables = {
"TS_NODE_CACHE": "true",
"TS_NODE_CACHE_DIRECTORY": "./ava-ts/",
"TS_NODE_PRETTY": "true",
"TS_NODE_COMPILER_OPTIONS": "{\"typeRoots\" : [\"./node_modules/@types\", \"./test/@types\"]}"
};
conf.require = [
"ts-node/register",
"tsconfig-paths/register"
];
}
export default conf;