File tree Expand file tree Collapse file tree 5 files changed +42
-12
lines changed
projects/igniteui-angular Expand file tree Collapse file tree 5 files changed +42
-12
lines changed Original file line number Diff line number Diff line change 3030 cache : ' npm'
3131 - name : Install packages
3232 run : npm install
33+ - name : Install Playwright Browsers
34+ run : npx playwright install --with-deps chromium
3335 - name : Lint Lib
3436 run : npm run lint:lib
3537 env :
Original file line number Diff line number Diff line change 172172 "builder" : " @angular/build:unit-test" ,
173173 "options" : {
174174 "tsConfig" : " projects/igniteui-angular/tsconfig.spec.json" ,
175+ "browsers" : [" chromium" ],
175176 "buildTarget" : " ::test" ,
176- "runnerConfig" : " ./vitest.config.ts"
177+ "runnerConfig" : " ./vitest.config.ts" ,
178+ "exclude" : [
179+ " **/migrations/**" ,
180+ " **/schematics/**" ,
181+ " **/cypress/**"
182+ ]
177183 }
178184 },
179185 "lint" : {
Original file line number Diff line number Diff line change 1+ import 'zone.js' ;
2+ import 'zone.js/testing' ;
3+
14import { getTestBed } from '@angular/core/testing' ;
25import {
36 BrowserDynamicTestingModule ,
@@ -28,8 +31,17 @@ expect.extend({
2831 }
2932} ) ;
3033
31- // Initialize the Angular testing environment
32- getTestBed ( ) . initTestEnvironment (
33- BrowserDynamicTestingModule ,
34- platformBrowserDynamicTesting ( ) ,
35- ) ;
34+ // Wait for Zone.js to be available
35+ if ( typeof Zone === 'undefined' ) {
36+ throw new Error ( 'Zone.js is required but not loaded' ) ;
37+ }
38+
39+ // Initialize the Angular testing environment only if not already initialized
40+ const testBed = getTestBed ( ) ;
41+ if ( ! ( testBed as any ) . platform ) {
42+ testBed . initTestEnvironment (
43+ BrowserDynamicTestingModule ,
44+ platformBrowserDynamicTesting ( ) ,
45+ { teardown : { destroyAfterEach : true } }
46+ ) ;
47+ }
Original file line number Diff line number Diff line change 1414 " hammerjs"
1515 ]
1616 },
17+ "files" : [],
1718 "exclude" : [
18- " migrations/**/*.spec.ts" ,
19- " schematics/**/*.spec.ts" ,
20- " cypress/**/*.spec.ts"
19+ " migrations" ,
20+ " schematics" ,
21+ " cypress" ,
22+ " node_modules"
2123 ],
2224 "include" : [
2325 " **/*.spec.ts" ,
Original file line number Diff line number Diff line change @@ -23,6 +23,13 @@ export default defineConfig({
2323 globals : true ,
2424 setupFiles : [ './projects/igniteui-angular/test-setup.ts' ] ,
2525 include : [ '**/*.spec.ts' ] ,
26+ exclude : [
27+ '**/node_modules/**' ,
28+ '**/dist/**' ,
29+ '**/migrations/**' ,
30+ '**/schematics/**' ,
31+ '**/cypress/**' ,
32+ ] ,
2633 browser : {
2734 headless : true ,
2835 provider : playwright ( ) ,
@@ -46,9 +53,10 @@ export default defineConfig({
4653 root : './projects/igniteui-angular' ,
4754 include : [ '**/*.spec.ts' ] ,
4855 exclude : [
49- 'migrations/**/*.spec.ts' ,
50- 'schematics/**/*.spec.ts' ,
51- 'cypress/**/*.spec.ts' ,
56+ '**/migrations/**' ,
57+ '**/schematics/**' ,
58+ '**/cypress/**' ,
59+ '**/node_modules/**' ,
5260 ] ,
5361 } ,
5462 } ,
You can’t perform that action at this time.
0 commit comments