Skip to content

Commit

Permalink
chore: update karma config for common
Browse files Browse the repository at this point in the history
  • Loading branch information
pubuzhixing8 committed Apr 17, 2024
1 parent 0ba04b9 commit a01dc94
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 54 deletions.
6 changes: 2 additions & 4 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,9 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "packages/common/src/test.ts",
"tsConfig": "packages/common/tsconfig.spec.json",
"polyfills": [
"zone.js",
"zone.js/testing"
]
"karmaConfig": "packages/common/karma.conf.js"
}
},
"lint": {
Expand Down
50 changes: 0 additions & 50 deletions karma.conf.js

This file was deleted.

9 changes: 9 additions & 0 deletions packages/common/src/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files

import 'zone.js';
import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), { teardown: { destroyAfterEach: true } });
3 changes: 3 additions & 0 deletions packages/common/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"jasmine"
]
},
"files": [
"src/test.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
Expand Down

0 comments on commit a01dc94

Please sign in to comment.