mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
include all modules in coverage
This commit is contained in:
@@ -38,25 +38,11 @@ testing.TestBed.initTestEnvironment(
|
|||||||
browser.platformBrowserDynamicTesting()
|
browser.platformBrowserDynamicTesting()
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
|
||||||
* Ok, this is kinda crazy. We can use the context method on
|
|
||||||
* require that webpack created in order to tell webpack
|
|
||||||
* what files we actually want to require or import.
|
|
||||||
* Below, context will be a function/object with file names as keys.
|
|
||||||
* Using that regex we are saying look in ../src then find
|
|
||||||
* any file that ends with spec.ts and get its path. By passing in true
|
|
||||||
* we say do this recursively
|
|
||||||
*/
|
|
||||||
var testContext = require.context('./src', true, /\.spec\.ts/);
|
|
||||||
|
|
||||||
/*
|
var tests = require.context('./src', true, /\.spec\.ts$/);
|
||||||
* get all the files, for each file, call the context function
|
|
||||||
* that will require the file and load it up here. Context will
|
|
||||||
* loop and require those spec files here
|
|
||||||
*/
|
|
||||||
function requireAll(requireContext) {
|
|
||||||
return requireContext.keys().map(requireContext);
|
|
||||||
}
|
|
||||||
|
|
||||||
// requires and returns all modules that match
|
tests.keys().forEach(tests);
|
||||||
var modules = requireAll(testContext);
|
|
||||||
|
const components = require.context('./src/app', true, /\.module\.ts$/);
|
||||||
|
|
||||||
|
components.keys().forEach(components);
|
||||||
|
@@ -7,7 +7,7 @@ import { bootloader } from '@angularclass/bootloader';
|
|||||||
|
|
||||||
import { load as loadWebFont } from 'webfontloader';
|
import { load as loadWebFont } from 'webfontloader';
|
||||||
|
|
||||||
import { BrowserAppModule } from './app/browser-app.module';
|
import { BrowserAppModule } from './modules/app/browser-app.module';
|
||||||
|
|
||||||
import { ENV_CONFIG } from './config';
|
import { ENV_CONFIG } from './config';
|
||||||
|
|
||||||
|
@@ -17,7 +17,7 @@ import { enableProdMode } from '@angular/core';
|
|||||||
|
|
||||||
import { ngExpressEngine } from '@nguniversal/express-engine';
|
import { ngExpressEngine } from '@nguniversal/express-engine';
|
||||||
|
|
||||||
import { ServerAppModule } from './app/server-app.module';
|
import { ServerAppModule } from './modules/app/server-app.module';
|
||||||
|
|
||||||
import { serverApi, createMockApi } from './backend/api';
|
import { serverApi, createMockApi } from './backend/api';
|
||||||
|
|
||||||
|
@@ -11,15 +11,15 @@ import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
|||||||
|
|
||||||
import { EffectsModule } from '@ngrx/effects';
|
import { EffectsModule } from '@ngrx/effects';
|
||||||
|
|
||||||
import { TransferState } from '../modules/transfer-state/transfer-state';
|
import { TransferState } from '../transfer-state/transfer-state';
|
||||||
import { BrowserTransferStateModule } from '../modules/transfer-state/browser-transfer-state.module';
|
import { BrowserTransferStateModule } from '../transfer-state/browser-transfer-state.module';
|
||||||
import { BrowserTransferStoreEffects } from '../modules/transfer-store/browser-transfer-store.effects';
|
import { BrowserTransferStoreEffects } from '../transfer-store/browser-transfer-store.effects';
|
||||||
import { BrowserTransferStoreModule } from '../modules/transfer-store/browser-transfer-store.module';
|
import { BrowserTransferStoreModule } from '../transfer-store/browser-transfer-store.module';
|
||||||
|
|
||||||
import { AppModule } from './app.module';
|
import { AppModule } from '../../app/app.module';
|
||||||
import { CoreModule } from './core/core.module';
|
import { CoreModule } from '../../app/core/core.module';
|
||||||
|
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from '../../app/app.component';
|
||||||
|
|
||||||
export function init(cache: TransferState) {
|
export function init(cache: TransferState) {
|
||||||
return () => {
|
return () => {
|
@@ -16,21 +16,21 @@ import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
|
|||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { EffectsModule } from '@ngrx/effects';
|
import { EffectsModule } from '@ngrx/effects';
|
||||||
|
|
||||||
import { TranslateUniversalLoader } from '../modules/translate-universal-loader';
|
import { TranslateUniversalLoader } from '../translate-universal-loader';
|
||||||
|
|
||||||
import { ServerTransferStateModule } from '../modules/transfer-state/server-transfer-state.module';
|
import { ServerTransferStateModule } from '../transfer-state/server-transfer-state.module';
|
||||||
import { TransferState } from '../modules/transfer-state/transfer-state';
|
import { TransferState } from '../transfer-state/transfer-state';
|
||||||
|
|
||||||
import { ServerTransferStoreEffects } from '../modules/transfer-store/server-transfer-store.effects';
|
import { ServerTransferStoreEffects } from '../transfer-store/server-transfer-store.effects';
|
||||||
import { ServerTransferStoreModule } from '../modules/transfer-store/server-transfer-store.module';
|
import { ServerTransferStoreModule } from '../transfer-store/server-transfer-store.module';
|
||||||
|
|
||||||
import { AppState } from './app.reducer';
|
import { AppState } from '../../app/app.reducer';
|
||||||
|
|
||||||
import { AppModule } from './app.module';
|
import { AppModule } from '../../app/app.module';
|
||||||
|
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from '../../app/app.component';
|
||||||
|
|
||||||
import { GLOBAL_CONFIG, GlobalConfig } from '../config';
|
import { GLOBAL_CONFIG, GlobalConfig } from '../../config';
|
||||||
|
|
||||||
export function boot(cache: TransferState, appRef: ApplicationRef, store: Store<AppState>, request: Request, config: GlobalConfig) {
|
export function boot(cache: TransferState, appRef: ApplicationRef, store: Store<AppState>, request: Request, config: GlobalConfig) {
|
||||||
// authentication mechanism goes here
|
// authentication mechanism goes here
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": "../tsconfig.json",
|
"extends": "../tsconfig.json",
|
||||||
"angularCompilerOptions": {
|
"angularCompilerOptions": {
|
||||||
"entryModule": "./app/browser-app.module#BrowserAppModule"
|
"entryModule": "./modules/app/browser-app.module#BrowserAppModule"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": "../tsconfig.json",
|
"extends": "../tsconfig.json",
|
||||||
"angularCompilerOptions": {
|
"angularCompilerOptions": {
|
||||||
"entryModule": "./app/server-app.module#ServerAppModule"
|
"entryModule": "./modules/app/server-app.module#ServerAppModule"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4,6 +4,6 @@
|
|||||||
"sourceMap": true
|
"sourceMap": true
|
||||||
},
|
},
|
||||||
"angularCompilerOptions": {
|
"angularCompilerOptions": {
|
||||||
"entryModule": "./app/browser-app.module#BrowserAppModule"
|
"entryModule": "./modules/app/browser-app.module#BrowserAppModule"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -225,8 +225,7 @@ module.exports = function (options) {
|
|||||||
|
|
||||||
new ContextReplacementPlugin(
|
new ContextReplacementPlugin(
|
||||||
/angular(\\|\/)core(\\|\/)@angular/,
|
/angular(\\|\/)core(\\|\/)@angular/,
|
||||||
root('./src'),
|
root('./src'), {}
|
||||||
{}
|
|
||||||
),
|
),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user