From d0a3baacee84913b93c1a96b83b70ea34389adc3 Mon Sep 17 00:00:00 2001 From: flolu Date: Fri, 27 Sep 2019 06:32:10 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix=20angular=20jest=20not=20pas?= =?UTF-8?q?sing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to https://stackoverflow.com/users/8797809 and https://github.com/thymikee/jest-preset-angular/issues/288#issuecomment-508130460 --- package.json | 2 +- services/frontend/src/app/app.component.spec.ts | 6 ++---- services/frontend/tsconfig.spec.json | 3 ++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 97c40fd1..2b4a0b07 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "fire": "yarn install && yarn build", "refire": "yarn clean && yarn fire", "start:dev": "npm-run-all --parallel build:watch start:docker:dev start:frontend", - "test": "lerna run test --ignore frontend", + "test": "lerna run test", "start": "yarn start:docker", "---": "---", "start:frontend": "lerna exec --scope frontend -- yarn start", diff --git a/services/frontend/src/app/app.component.spec.ts b/services/frontend/src/app/app.component.spec.ts index ae066605..2e871475 100644 --- a/services/frontend/src/app/app.component.spec.ts +++ b/services/frontend/src/app/app.component.spec.ts @@ -8,11 +8,9 @@ import { IdeasService } from './ideas.service'; describe('AppComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - imports: [RouterTestingModule, ReactiveFormsModule /* HttpClientModule */], + imports: [RouterTestingModule, ReactiveFormsModule, HttpClientModule], declarations: [AppComponent], - providers: [ - /* IdeasService */ - ], + providers: [IdeasService], }).compileComponents(); })); diff --git a/services/frontend/tsconfig.spec.json b/services/frontend/tsconfig.spec.json index a7024fa2..fade5892 100644 --- a/services/frontend/tsconfig.spec.json +++ b/services/frontend/tsconfig.spec.json @@ -3,7 +3,8 @@ "compilerOptions": { "outDir": "./out-tsc/spec", "types": ["jest", "node"], - "module": "commonjs" + "module": "commonjs", + "emitDecoratorMetadata": true }, "files": ["src/test.ts", "src/polyfills.ts"], "include": ["src/**/*.spec.ts", "src/**/*.d.ts"]