test.ts 635 B

123456789101112131415161718192021222324
  1. import 'zone.js/dist/zone-testing';
  2. import './test-setup'; // Patch global
  3. import { getTestBed } from '@angular/core/testing';
  4. import {
  5. BrowserDynamicTestingModule,
  6. platformBrowserDynamicTesting
  7. } from '@angular/platform-browser-dynamic/testing';
  8. declare const require: {
  9. context(path: string, deep?: boolean, filter?: RegExp): {
  10. keys(): string[];
  11. <T>(id: string): T;
  12. };
  13. };
  14. // Initialisation Angular
  15. getTestBed().initTestEnvironment(
  16. BrowserDynamicTestingModule,
  17. platformBrowserDynamicTesting()
  18. );
  19. // Charger tous les tests
  20. const context = require.context('./', true, /\.spec\.ts$/);
  21. context.keys().map(context);