forked from spinnaker/deck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma-shim.js
40 lines (30 loc) · 1.2 KB
/
karma-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
Error.stackTraceLimit = Infinity;
// jquery has to be first or many a test will break
global.$ = global.jQuery = require('jquery');
// angular 1 test harnesss
require('angular');
require('angular-mocks');
// polyfills
require('core-js/client/shim');
// not sure, but angular 2 says these are required
// there's definitely some overlap with the polyfills
require('core-js/client/shim');
require('reflect-metadata');
// for consolidating TS-generated helpers
// should be able to remove for TS 2.2
require('ts-helpers');
require('zone.js/dist/zone');
require('zone.js/dist/long-stack-trace-zone');
require('zone.js/dist/proxy');
require('zone.js/dist/sync-test');
require('zone.js/dist/jasmine-patch');
require('zone.js/dist/async-test');
require('zone.js/dist/fake-async-test');
require('rxjs/Rx');
require('./settings.js');
require('./app/scripts/app.module');
const testContext = require.context('./app/scripts/', true, /\.spec\.(js|ts)$/);
testContext.keys().forEach(testContext);
const testing = require('@angular/core/testing');
const browser = require('@angular/platform-browser-dynamic/testing');
testing.TestBed.initTestEnvironment(browser.BrowserDynamicTestingModule, browser.platformBrowserDynamicTesting());