forked from httptoolkit/mockthereum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.ts
54 lines (48 loc) · 1.44 KB
/
karma.conf.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
/*
* SPDX-FileCopyrightText: 2022 Tim Perry <tim@httptoolkit.tech>
* SPDX-License-Identifier: Apache-2.0
*/
import { NodeModulesPolyfillPlugin } from '@esbuild-plugins/node-modules-polyfill';
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill';
const CONTINUOUS = process.env.CONTINUOUS_TEST === 'true';
const HEADFUL = process.env.HEADFUL_TEST === 'true';
require('./test/start-test-admin-server');
module.exports = function(config: any) {
config.set({
frameworks: ['mocha', 'chai'],
files: [
'test/**/*.spec.ts'
],
preprocessors: {
'src/**/*.ts': ['esbuild'],
'test/**/*.ts': ['esbuild']
},
esbuild: {
format: 'esm',
target: 'esnext',
external: ['http-encoding'],
plugins: [
NodeModulesPolyfillPlugin(),
NodeGlobalsPolyfillPlugin({
process: true,
buffer: true
})
]
},
plugins: [
'karma-chrome-launcher',
'karma-chai',
'karma-mocha',
'karma-spec-reporter',
'karma-esbuild'
],
reporters: ['spec'],
port: 9876,
logLevel: config.LOG_INFO,
browsers: HEADFUL
? ['Chrome']
: ['ChromeHeadless'],
autoWatch: CONTINUOUS,
singleRun: !CONTINUOUS
});
};