-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@angular-devkit/build-angular): load polyfills and runtime as scr…
…ipts instead of modules This commit updates changes the way polyfills and runtime are loaded from modules to scripts. This is required as otherwise Jasmine will be loaded prior to Zone.js which causes clock patching not to work. Closes #24651
- Loading branch information
1 parent
175b716
commit bf3be56
Showing
3 changed files
with
41 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { ng } from '../../utils/process'; | ||
import { writeFile } from '../../utils/fs'; | ||
|
||
export default async function () { | ||
await writeFile( | ||
'src/app/app.component.spec.ts', | ||
` | ||
import { TestBed } from '@angular/core/testing'; | ||
import { RouterTestingModule } from '@angular/router/testing'; | ||
import { AppComponent } from './app.component'; | ||
describe('AppComponent', () => { | ||
beforeAll(() => { | ||
jasmine.clock().install(); | ||
}); | ||
afterAll(() => { | ||
jasmine.clock().uninstall(); | ||
}); | ||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [RouterTestingModule], | ||
declarations: [AppComponent], | ||
}).compileComponents(); | ||
}); | ||
it('should create the app', () => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
expect(fixture.componentInstance).toBeTruthy(); | ||
}); | ||
}); | ||
`, | ||
); | ||
|
||
await ng('test', '--watch=false'); | ||
} |