您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

33 行
1.1 KiB

  1. // This file is required by karma.conf.js and loads recursively all the .spec and framework files
  2. import 'zone.js/dist/long-stack-trace-zone';
  3. import 'zone.js/dist/proxy.js';
  4. import 'zone.js/dist/sync-test';
  5. import 'zone.js/dist/jasmine-patch';
  6. import 'zone.js/dist/async-test';
  7. import 'zone.js/dist/fake-async-test';
  8. import { getTestBed } from '@angular/core/testing';
  9. import {
  10. BrowserDynamicTestingModule,
  11. platformBrowserDynamicTesting
  12. } from '@angular/platform-browser-dynamic/testing';
  13. // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
  14. declare const __karma__: any;
  15. declare const require: any;
  16. // Prevent Karma from running prematurely.
  17. __karma__.loaded = function () {};
  18. // First, initialize the Angular testing environment.
  19. getTestBed().initTestEnvironment(
  20. BrowserDynamicTestingModule,
  21. platformBrowserDynamicTesting()
  22. );
  23. // Then we find all the tests.
  24. const context = require.context('./', true, /\.spec\.ts$/);
  25. // And load the modules.
  26. context.keys().map(context);
  27. // Finally, start Karma to run the tests.
  28. __karma__.start();