Skip to content

Commit feebb55

Browse files
Hristo313Hristo HristovLipata
authored
fix(ng, standalone): add test setup file for angular standalone (#1421)
* fix(angular): add test setup file * chore: release version 14.5.6-beta.1 * chore: release version 14.5.6-beta.2 * chore: fix indentation * chore: revert beta release --------- Co-authored-by: Hristo Hristov <[email protected]> Co-authored-by: lipata <[email protected]>
1 parent bcd62be commit feebb55

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

packages/igx-templates/igx-ts-legacy/projects/_base/files/src/test.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@
22

33
import 'zone.js/testing';
44
import { getTestBed } from '@angular/core/testing';
5-
import {
6-
BrowserDynamicTestingModule,
7-
platformBrowserDynamicTesting
8-
} from '@angular/platform-browser-dynamic/testing';
5+
import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';
96

107
// First, initialize the Angular testing environment.
118
getTestBed().initTestEnvironment(
12-
BrowserDynamicTestingModule,
13-
platformBrowserDynamicTesting(), {
9+
BrowserTestingModule,
10+
platformBrowserTesting(), {
1411
teardown: { destroyAfterEach: false }
1512
}
1613
);

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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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 { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';
6+
7+
// First, initialize the Angular testing environment.
8+
getTestBed().initTestEnvironment(
9+
BrowserTestingModule,
10+
platformBrowserTesting(), {
11+
teardown: { destroyAfterEach: false }
12+
}
13+
);

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)