test.ts 763 B

1234567891011121314151617181920212223242526272829
  1. // This file is required by karma.conf.js and loads recursively all the .spec and framework files
  2. import 'zone.js/testing';
  3. import {
  4. BrowserDynamicTestingModule,
  5. platformBrowserDynamicTesting,
  6. } from '@angular/platform-browser-dynamic/testing';
  7. import {getTestBed} from '@angular/core/testing';
  8. declare const require: {
  9. context(
  10. path: string,
  11. deep?: boolean,
  12. filter?: RegExp
  13. ): {
  14. keys(): string[];
  15. <T>(id: string): T;
  16. };
  17. };
  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('../src/', true, /\.spec\.ts$/);
  25. // And load the modules.
  26. context.keys().map(context);