forked from SilverHoodCorp/polar-bookshelf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
54 lines (43 loc) · 1.29 KB
/
karma.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
const webpackConfig = require("./webpack.config");
// if (process.env.CIRCLECI === 'true') {
// console.log("Setting up CHROME_BIN for circleci");
// process.env.CHROME_BIN = require('puppeteer').executablePath();
// }
// TODO: do not run the karma-typescript directly.
// instead run npx tsc --watch and then have these run under chrome so I can
// watch the output.
//
module.exports = (config) => {
config.set({
// ... normal karma configuration
// browsers: ['Chrome'],
browsers: ['ChromeHeadless'],
// make sure to include webpack as a framework
frameworks: ['mocha', 'webpack'],
plugins: [
'karma-chrome-launcher',
'karma-webpack',
'karma-mocha',
],
files: [
// { pattern: 'web/js/**/*Test.ts', watched: false },
// { pattern: 'apps/**/*Test.ts', watched: false },
{ pattern: 'web/**/*Karma.ts', watched: false },
],
preprocessors: {
// add webpack as preprocessor
'apps/**/*.ts': ['webpack'],
'web/**/*.ts': ['webpack'],
},
singleRun: true,
webpack: {
// karma watches the test entry points
// Do NOT specify the entry option
// webpack watches dependencies
// webpack configuration
...webpackConfig,
entry: undefined,
devtool: "eval",
},
});
}