forked from DevExpress/devextreme-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.test.shim.js
40 lines (34 loc) · 1.02 KB
/
karma.test.shim.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
// /*global jasmine, __karma__, window*/
Error.stackTraceLimit = Infinity;
jasmine.DEFAULT_TIMEOUT_INTERVAL = 2000;
__karma__.loaded = function () {};
function isSpecFile(path) {
return /\.spec\.js$/.test(path);
}
var allSpecFiles = Object.keys(window.__karma__.files)
.filter(isSpecFile);
System.config({
baseURL: '/base',
packageWithIndex: true
});
System.import('karma.systemjs.conf.js')
.then(function () {
return Promise.all([
System.import('@angular/core/testing'),
System.import('@angular/platform-browser-dynamic/testing')
])
})
.then(function (providers) {
var coreTesting = providers[0];
var browserTesting = providers[1];
coreTesting.TestBed.initTestEnvironment(
browserTesting.BrowserDynamicTestingModule,
browserTesting.platformBrowserDynamicTesting());
})
.then(function() {
return Promise.all(
allSpecFiles.map(function (moduleName) {
return System.import(moduleName);
}));
})
.then(__karma__.start, __karma__.error);