@@ -6,6 +6,11 @@ import 'zone.js/dist/sync-test';
66import 'zone.js/dist/jasmine-patch' ;
77import 'zone.js/dist/async-test' ;
88import 'zone.js/dist/fake-async-test' ;
9+ import { getTestBed } from '@angular/core/testing' ;
10+ import {
11+ BrowserDynamicTestingModule ,
12+ platformBrowserDynamicTesting
13+ } from '@angular/platform-browser-dynamic/testing' ;
914
1015// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
1116declare var __karma__ : any ;
@@ -14,30 +19,14 @@ declare var require: any;
1419// Prevent Karma from running prematurely.
1520__karma__ . loaded = function ( ) { } ;
1621
17-
18- Promise . all ( [
19- System . import ( '@angular/core/testing' ) ,
20- System . import ( '@angular/platform-browser-dynamic/testing' )
21- ] )
22- // First, initialize the Angular testing environment.
23- . then ( ( [ testing , testingBrowser ] ) => {
24- testing . getTestBed ( ) . initTestEnvironment (
25- testingBrowser . BrowserDynamicTestingModule ,
26- testingBrowser . platformBrowserDynamicTesting ( )
27- ) ;
28- } )
29- // Then we find all the tests.
30- . then ( ( ) => require . context ( './' , true , / \. s p e c \. t s / ) )
31- // And load the modules.
32- . then ( context => {
33- try {
34- return context . keys ( ) . map ( context ) ;
35- } catch ( e ) {
36- if ( console ) {
37- console . error ( e . message , e . stack ) ;
38- }
39- throw e ;
40- }
41- } )
42- // Finally, start Karma to run the tests.
43- . then ( __karma__ . start , __karma__ . error ) ;
22+ // First, initialize the Angular testing environment.
23+ getTestBed ( ) . initTestEnvironment (
24+ BrowserDynamicTestingModule ,
25+ platformBrowserDynamicTesting ( )
26+ ) ;
27+ // Then we find all the tests.
28+ let context = require . context ( './' , true , / \. s p e c \. t s / ) ;
29+ // And load the modules.
30+ context . keys ( ) . map ( context ) ;
31+ // Finally, start Karma to run the tests.
32+ __karma__ . start ( ) ;
0 commit comments