mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
49 lines
1.4 KiB
JavaScript
49 lines
1.4 KiB
JavaScript
/**
|
|
* @author: @AngularClass
|
|
*/
|
|
|
|
/*
|
|
* When testing with webpack and ES6, we have to do some extra
|
|
* things to get testing to work right. Because we are gonna write tests
|
|
* in ES6 too, we have to compile those as well. That's handled in
|
|
* karma.conf.js with the karma-webpack plugin. This is the entry
|
|
* file for webpack test. Just like webpack will create a bundle.js
|
|
* file for our client, when we run test, it will compile and bundle them
|
|
* all here! Crazy huh. So we need to do some setup
|
|
*/
|
|
Error.stackTraceLimit = Infinity;
|
|
|
|
require('core-js/es6');
|
|
require('core-js/es7/reflect');
|
|
|
|
// Typescript emit helpers polyfill
|
|
require('ts-helpers');
|
|
|
|
require('zone.js/dist/zone');
|
|
require('zone.js/dist/long-stack-trace-zone');
|
|
require('zone.js/dist/proxy'); // since zone.js 0.6.15
|
|
require('zone.js/dist/sync-test');
|
|
require('zone.js/dist/jasmine-patch'); // put here since zone.js 0.6.14
|
|
require('zone.js/dist/async-test');
|
|
require('zone.js/dist/fake-async-test');
|
|
|
|
// RxJS
|
|
require('rxjs/Rx');
|
|
|
|
var testing = require('@angular/core/testing');
|
|
var browser = require('@angular/platform-browser-dynamic/testing');
|
|
|
|
testing.TestBed.initTestEnvironment(
|
|
browser.BrowserDynamicTestingModule,
|
|
browser.platformBrowserDynamicTesting()
|
|
);
|
|
|
|
var tests = require.context('./src', true, /\.spec\.ts$/);
|
|
|
|
tests.keys().forEach(tests);
|
|
|
|
// includes all modules into test coverage
|
|
const modules = require.context('./src/app', true, /\.module\.ts$/);
|
|
|
|
modules.keys().forEach(modules);
|