forked from DefinitelyTyped/DefinitelyTyped
/
wallabyjs-tests.ts
126 lines (103 loc) · 3.64 KB
/
wallabyjs-tests.ts
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import { Application, Express } from "express";
import * as wallabyjs from "wallabyjs";
interface MyTestRunner {
foo: number;
}
const myCompiler: wallabyjs.IWallabyCompiler = (file: wallabyjs.IWallabyFile) => {
return {
code: file.content,
map: file.content,
ranges: [],
};
};
export class WallabyConfig implements wallabyjs.IWallabyConfig {
public files: Array<string | wallabyjs.IWallabyFilePattern> = [
"src/**/*.ts",
"!src/**/*.spec.ts",
{ pattern: "src/**/*.css", instrument: false },
];
public tests: Array<string | wallabyjs.IWallabyFilePattern> = [
"src/**/*.spec.ts",
{ pattern: "src/**/*.css", instrument: false, load: true, binary: true },
];
public compilers: wallabyjs.IWallabyCompilers = {
"src/**/*.js": this.wallaby.compilers.babel({ babelrc: true }),
"src/**/*.ts": this.wallaby.compilers.typeScript({ strict: true }),
"src/**/*.coffee": this.wallaby.compilers.coffeeScript({ bare: true }),
"src/**/*.my": myCompiler,
};
public preprocessors: wallabyjs.IWallabyProcessors = {
"**/*.js": file => file.content + "\n// this is JavaScript",
"**/*.ts": file => file.content + "\n// this is TypeScript",
};
public postprocessor: wallabyjs.IWallabyProcessors = {
"**/*.js": file => file.content + "\n// this is JavaScript",
"**/*.ts": file => file.content + "\n// this is TypeScript",
};
public env: wallabyjs.IWallabyEnvironment = {
type: "node",
params: {
env: "KEY1=value1;KEY2=value2",
runner: "--arg1;--arg2;",
},
viewportSize: {
width: 800,
},
};
public async setup(wallaby: wallabyjs.IWallabyTestRunnerContext<MyTestRunner>) {
const foo: number = wallaby.testFramework.foo;
}
public teardown(wallaby: wallabyjs.IWallabyTestRunnerContext<MyTestRunner>) {
const foo: number = wallaby.testFramework.foo;
}
public middleware(app: Application, express: Express) {
app.use((req, res, next) => {
next();
});
}
public hints = {
ignoreCoverage: /wallaby ignore next/,
ignoreCoverageForFile: "wallaby ignore file",
};
public startMode = "never" as const;
public pattern = "**/*.js";
public autoDetect = ["angular", "vitest"] as const;
public delays = {
run: 50,
};
public runMode = "onsave" as const;
public logLimits = {
inline: {
// The depth to log for values displayed inline beside your code
depth: 5,
// The maximum number of elements to log for values displayed
// inline beside your code
elements: 5000,
},
values: {
default: {
// The string length at which strings are truncated within
// value explorer and log messages
stringLength: 200,
},
autoExpand: {
// The string length at which strings are truncated when
// using the auto-expand feature
stringLength: 8192,
// The maximum number of elements to log for values displayed
// using the auto-expand feature
elements: 5000,
// The maximum depth to log for values displayed using the
// auto-expand feature
depth: 10,
},
},
};
public workers = {
recycle: true,
restart: true,
initial: 6,
regular: 2
}
constructor(private readonly wallaby: wallabyjs.IWallaby) {}
}