-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathkarma.conf.js
More file actions
38 lines (38 loc) · 1.19 KB
/
karma.conf.js
File metadata and controls
38 lines (38 loc) · 1.19 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
module.exports = function (config) {
config.set({
frameworks: ['jasmine', 'karma-typescript'],
files: [{ pattern: 'test/**/*.ts' }, { pattern: 'lib/**/*.ts'}],
preprocessors: {
"**/*.ts": "karma-typescript"
},
reporters: ['progress', 'karma-typescript'],
karmaTypescriptConfig: {
bundlerOptions: {
acornOptions: {
ecmaVersion: 'latest',
},
resolve: {
alias: {
croner: require('path').resolve(__dirname, 'node_modules/croner/dist/croner.cjs'),
},
extensions: ['.js', '.json', '.mjs', '.cjs', '.ts', '.tsx'],
},
transforms: [
function (context, callback) {
if (context.filename && context.filename.endsWith('.cjs')) {
return callback(undefined, { dirty: true, transformedScript: true })
}
return callback(undefined, { dirty: false })
},
],
},
},
port: 9876, // karma web server port
colors: true,
logLevel: config.LOG_INFO,
browsers: ['ChromeHeadless'],
autoWatch: false,
singleRun: true, // Karma captures browsers, runs the tests and exits
concurrency: Infinity,
})
}