Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8b2ca7a

Browse filesBrowse files
committed
fix(@angular/build): setup unit-test polyfills before TestBed init
To ensure that Zone.js is fully setup and patched prior to the use of TestBed, the setup file order for the `vitest` runner of the `unit-test` builder has been swapped. This is particularly relevant for `fakeAsync` which has a module level statement that attempts to capture the `Zone` instance. If Zone.js is not setup at that point, fakeAsync will fail to function in tests.
1 parent 7b8c9af commit 8b2ca7a
Copy full SHA for 8b2ca7a

File tree

1 file changed

+1
-1
lines changed
Filter options
  • packages/angular/build/src/builders/unit-test

1 file changed

+1
-1
lines changed

‎packages/angular/build/src/builders/unit-test/builder.ts

Copy file name to clipboardExpand all lines: packages/angular/build/src/builders/unit-test/builder.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export async function* execute(
194194
// Add setup file entries for TestBed initialization and project polyfills
195195
const setupFiles = ['init-testbed.js'];
196196
if (buildTargetOptions?.polyfills?.length) {
197-
setupFiles.push('polyfills.js');
197+
setupFiles.unshift('polyfills.js');
198198
}
199199

200200
try {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.