Skip to content
Snippets Groups Projects
Select Git revision
  • 33c6d6e7f9de46e7a49b497947ff2159e7d39c03
  • master default protected
  • 6
  • 6.1
  • 6.1.7
  • 6.1.6
  • 6.1.5
  • 6.1.4
  • 6.1.3
  • 6.1.2
  • 6.1.1
  • 6.1.0
  • 6.0
  • 6.0.0
  • 5.14
  • 5.14.1
  • 5.14.0
  • 5.13
  • 5.13.3
  • 5.13.2
  • 5.13.1
  • 5.13.0
22 results

README.md

Blame
  • test.ts 1.22 KiB
    /**
     * @license
     * Copyright Akveo. All Rights Reserved.
     * Licensed under the MIT License. See License.txt in the project root for license information.
     */
    
    // This file is required by karma.conf.js and loads recursively all the .spec and framework files
    
    import 'zone.js/dist/long-stack-trace-zone';
    import 'zone.js/dist/proxy.js';
    import 'zone.js/dist/sync-test';
    import 'zone.js/dist/jasmine-patch';
    import 'zone.js/dist/async-test';
    import 'zone.js/dist/fake-async-test';
    import { getTestBed } from '@angular/core/testing';
    import {
      BrowserDynamicTestingModule,
      platformBrowserDynamicTesting,
    } from '@angular/platform-browser-dynamic/testing';
    
    // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
    declare const __karma__: any;
    declare const require: any;
    
    // Prevent Karma from running prematurely.
    __karma__.loaded = function () {};
    
    // First, initialize the Angular testing environment.
    getTestBed().initTestEnvironment(
      BrowserDynamicTestingModule,
      platformBrowserDynamicTesting(),
    );
    // Then we find all the tests.
    const context = require.context('./', true, /\.spec\.ts$/);
    // And load the modules.
    context.keys().map(context);
    // Finally, start Karma to run the tests.
    __karma__.start();