Skip to content

Commit 17880a1

Browse files
Hristo HristovHristo Hristov
authored andcommitted
fix(angular): add test setup file
1 parent bcd62be commit 17880a1

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

packages/igx-templates/igx-ts/projects/_base/files/angular.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"test": {
8787
"builder": "@angular-devkit/build-angular:karma",
8888
"options": {
89+
"main": "src/test.ts",
8990
"polyfills": [
9091
"zone.js",
9192
"zone.js/testing"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
2+
3+
import 'zone.js/testing';
4+
import { getTestBed } from '@angular/core/testing';
5+
import {
6+
BrowserTestingModule,
7+
platformBrowserTesting
8+
} from '@angular/platform-browser-dynamic/testing';
9+
10+
// First, initialize the Angular testing environment.
11+
getTestBed().initTestEnvironment(
12+
BrowserTestingModule,
13+
platformBrowserTesting(), {
14+
teardown: { destroyAfterEach: false }
15+
}
16+
);

packages/igx-templates/igx-ts/projects/_base/files/tsconfig.spec.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"jasmine"
88
]
99
},
10+
"files": [
11+
"src/test.ts"
12+
],
1013
"include": [
1114
"src/**/*.spec.ts",
1215
"src/**/*.d.ts"

0 commit comments

Comments
 (0)