-
Notifications
You must be signed in to change notification settings - Fork 59
/
karma.conf.js
144 lines (131 loc) · 2.71 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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
'use strict';
const lernaJson = require('./lerna.json');
let localLaunchers = {
ChromeNoSandboxHeadless: {
base: 'Chrome',
flags: [
'--no-sandbox',
'--headless',
'--disable-gpu',
// Without a remote debugging port, Google Chrome exits immediately.
'--remote-debugging-port=9333',
],
},
};
module.exports = function(config) {
config.set({
browserify: {
debug: true,
transform: [
[
'babelify',
{
presets: ['env'],
},
],
],
insertGlobalVars: {
METAL_VERSION: function() {
return '\'' + lernaJson.version + '\'';
},
},
},
browsers: Object.keys(localLaunchers),
client: {
mocha: {
timeout: 4000,
},
},
customLaunchers: localLaunchers,
exclude: ['packages/metal-isomorphic/**/*.js'],
files: [
// Since all files will be added, we need to ensure manually that these
// will be added first.
{
pattern:
'packages/metal-incremental-dom/src/incremental-dom.js',
watched: false,
included: true,
served: true,
},
{
pattern:
'packages/metal-incremental-dom/lib/incremental-dom.js',
watched: false,
included: true,
served: true,
},
{
pattern:
'packages/metal-soy/node_modules/metal-soy-bundle/lib/bundle.js',
watched: false,
included: true,
served: true,
},
{
pattern:
'packages/metal-web-component/node_modules/babel-polyfill/dist/polyfill.min.js',
watched: false,
included: true,
served: true,
},
{
pattern:
'packages/metal-web-component/node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js',
watched: false,
included: false,
served: true,
},
{
pattern:
'packages/metal-web-component/webcomponents_polyfill.js',
watched: false,
included: true,
served: true,
},
{
pattern: 'packages/metal*/test/**/*.js',
watched: false,
included: true,
served: true,
},
{
pattern: 'packages/metal-dom/fixtures/*',
watched: true,
included: false,
served: true,
},
],
frameworks: [
'browserify',
'mocha',
'chai',
'sinon',
'source-map-support',
],
plugins: [
'karma-browserify',
'karma-chai',
'karma-chrome-launcher',
'karma-mocha',
'karma-sinon',
'karma-source-map-support',
],
preprocessors: {
'packages/metal-incremental-dom/src/incremental-dom.js': [
'browserify',
],
'packages/metal-incremental-dom/lib/incremental-dom.js': [
'browserify',
],
'packages/metal-soy/node_modules/metal-soy-bundle/lib/bundle.js': [
'browserify',
],
'packages/metal*/test/**/*.js': ['browserify'],
},
proxies: {
'/fixtures/': '/base/packages/metal-dom/fixtures/',
},
singleRun: true,
});
};