forked from Aaronius/penpal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkarma.conf.cjs
More file actions
73 lines (72 loc) · 1.95 KB
/
karma.conf.cjs
File metadata and controls
73 lines (72 loc) · 1.95 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
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
const typescript = require('@rollup/plugin-typescript');
module.exports = (config) => {
config.set({
browsers: [
'Chrome',
// 'Firefox',
// 'Edge',
// 'Safari'
],
files: [
{
pattern: 'test/childFixtures/{pages,workers}/**',
watched: true,
included: false,
served: true,
},
{
pattern: 'dist/penpal.js',
watched: true,
included: false,
served: true,
},
'test/**/*.spec.ts',
],
proxies: {
'/penpal.js': '/base/dist/penpal.js',
'/pages': '/base/test/childFixtures/pages',
'/workers': '/base/test/childFixtures/workers',
// This specific path is very important. Due to browser security, the
// service worker file must be loaded from the root directory in order for
// the service worker to be able to control the page the tests are
// running in. Learn more by looking up "service worker scope".
'/serviceWorker.js': '/base/test/childFixtures/workers/serviceWorker.js',
},
proxyValidateSSL: false,
plugins: [
'@metahub/karma-rollup-preprocessor',
'karma-jasmine',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-safari-launcher',
'@chiragrupani/karma-chromium-edge-launcher',
],
preprocessors: {
'test/**/*.ts': ['rollup'],
},
rollupPreprocessor: {
options: {
output: {
// To include inlined sourcemaps as data URIs
sourcemap: true,
format: 'iife',
},
plugins: [
typescript({
// Fail testing if types are wrong.
noEmitOnError: true,
include: ['test/**/*', 'src/**/*'],
}),
],
},
},
frameworks: ['jasmine'],
colors: true,
logLevel: config.LOG_INFO,
// logLevel: config.LOG_DEBUG,
autoWatch: true,
reporters: ['dots'],
singleRun: false,
concurrency: Infinity,
});
};