Skip to content
Snippets Groups Projects
test.ts 1.47 KiB
Newer Older
  • Learn to ignore specific revisions
  • Martin Mechtel's avatar
    Martin Mechtel committed
    // This file is required by karma.conf.js and loads recursively all the .spec and framework files
    
    import 'zone.js/dist/zone-testing';
    import { getTestBed } from '@angular/core/testing';
    import {
      BrowserDynamicTestingModule,
      platformBrowserDynamicTesting
    } from '@angular/platform-browser-dynamic/testing';
    
    rhenck's avatar
    rhenck committed
    import { StaticProvider } from '@angular/core';
    import { environment } from './environments/environment';
    
    import { name, version, repository } from '../package.json';
    
    Martin Mechtel's avatar
    Martin Mechtel committed
    
    declare const require: any;
    
    // First, initialize the Angular testing environment.
    getTestBed().initTestEnvironment(
      BrowserDynamicTestingModule,
    
      platformBrowserDynamicTesting(<StaticProvider[]>[
        {
          provide: 'SERVER_URL',
          useValue: environment.testcenterUrl
        },
        {
          provide: 'APP_PUBLISHER',
          useValue: environment.appPublisher
        },
        {
          provide: 'APP_NAME',
    
        },
        {
          provide: 'API_VERSION_EXPECTED',
          useValue: environment.apiVersionExpected
    
    mechtelm's avatar
    mechtelm committed
        {
          provide: 'VERONA_API_VERSION_SUPPORTED',
          useValue: environment.veronaApiVersionSupported
        },
    
        {
          provide: 'REPOSITORY_URL',
          useValue: repository.url
        },
    
        {
          provide: 'IS_PRODUCTION_MODE',
          useValue: environment.production
    
    Martin Mechtel's avatar
    Martin Mechtel committed
    );
    // Then we find all the tests.
    const context = require.context('./', true, /\.spec\.ts$/);
    // And load the modules.
    context.keys().map(context);