diff --git a/package.json b/package.json index b1b6060eaf..b7ed6e3d3e 100644 --- a/package.json +++ b/package.json @@ -17,9 +17,9 @@ "build:stats": "ng build --stats-json", "build:prod": "yarn run build:ssr", "build:ssr": "ng build --configuration production && ng run dspace-angular:server:production", - "test": "ng test --sourceMap=true --watch=false --configuration test", - "test:watch": "nodemon --exec \"ng test --sourceMap=true --watch=true --configuration test\"", - "test:headless": "ng test --sourceMap=true --watch=false --configuration test --browsers=ChromeHeadless --code-coverage", + "test": "ng test --source-map=true --watch=false --configuration test", + "test:watch": "nodemon --exec \"ng test --source-map=true --watch=true --configuration test\"", + "test:headless": "ng test --source-map=true --watch=false --configuration test --browsers=ChromeHeadless --code-coverage", "lint": "ng lint", "lint-fix": "ng lint --fix=true", "e2e": "ng e2e", @@ -203,4 +203,4 @@ "webpack-cli": "^4.2.0", "webpack-dev-server": "^4.5.0" } -} \ No newline at end of file +} diff --git a/src/app/shared/testing/utils.test.ts b/src/app/shared/testing/utils.test.ts index 2f3b85d791..e5130d6182 100644 --- a/src/app/shared/testing/utils.test.ts +++ b/src/app/shared/testing/utils.test.ts @@ -72,7 +72,7 @@ export function createPaginatedList(objects?: T[]): PaginatedList { * @param prop The property/function to spy on */ export function spyOnExported(target: T, prop: keyof T): jasmine.Spy { - const spy = jasmine.createSpy(`${prop}Spy`); + const spy = jasmine.createSpy(`${String(prop)}Spy`); spyOnProperty(target, prop).and.returnValue(spy); return spy; } diff --git a/src/test.ts b/src/test.ts index 477195418b..2f07cf0d1d 100644 --- a/src/test.ts +++ b/src/test.ts @@ -9,8 +9,6 @@ import { } from '@angular/platform-browser-dynamic/testing'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -declare const require: any; - // First, initialize the Angular testing environment. getTestBed().initTestEnvironment( BrowserDynamicTestingModule, @@ -24,8 +22,3 @@ jasmine.getEnv().afterEach(() => { // Close any leftover modals getTestBed().inject(NgbModal, null)?.dismissAll?.(); }); - -// Then we find all the tests. -const context = require.context('./', true, /\.spec\.ts$/); -// And load the modules. -context.keys().map(context);