You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src\app\app.component.spec.ts:
1995 | * @internal strip this from published d.ts files due to
1996 | * microsoft/TypeScript#36216
1997 | */
1998 | get compiler() {
1999 | if (this._compiler === null) {
2000 | throw new Error(Need to call TestBed.initTestEnvironment() first);
^
error: Need to call TestBed.initTestEnvironment() first
at compiler (D:\scratch\ng-bun-test\node_modules@angular\core\fesm2022\testing.mjs:2000:19)
at configureTestingModule (D:\scratch\ng-bun-test\node_modules@angular\core\fesm2022\testing.mjs:1903:9)
at D:\scratch\ng-bun-test\src\app\app.component.spec.ts:6:11
at D:\scratch\ng-bun-test\src\app\app.component.spec.ts:5:14
✗ AppComponent > should create the app [2.67ms]
✗ AppComponent > should create the app
1995 | * @internal strip this from published d.ts files due to
1996 | * microsoft/TypeScript#36216
1997 | */
1998 | get compiler() {
1999 | if (this._compiler === null) {
2000 | throw new Error(Need to call TestBed.initTestEnvironment() first);
^
error: Need to call TestBed.initTestEnvironment() first
at compiler (D:\scratch\ng-bun-test\node_modules@angular\core\fesm2022\testing.mjs:2000:19)
at configureTestingModule (D:\scratch\ng-bun-test\node_modules@angular\core\fesm2022\testing.mjs:1903:9)
at D:\scratch\ng-bun-test\src\app\app.component.spec.ts:6:11
at D:\scratch\ng-bun-test\src\app\app.component.spec.ts:5:14
✗ AppComponent > should have the 'ng-bun-test' title [3.71ms]
✗ AppComponent > should have the 'ng-bun-test' title
1995 | * @internal strip this from published d.ts files due to
1996 | * microsoft/TypeScript#36216
1997 | */
1998 | get compiler() {
1999 | if (this._compiler === null) {
2000 | throw new Error(Need to call TestBed.initTestEnvironment() first);
^
error: Need to call TestBed.initTestEnvironment() first
at compiler (D:\scratch\ng-bun-test\node_modules@angular\core\fesm2022\testing.mjs:2000:19)
at configureTestingModule (D:\scratch\ng-bun-test\node_modules@angular\core\fesm2022\testing.mjs:1903:9)
at D:\scratch\ng-bun-test\src\app\app.component.spec.ts:6:11
at D:\scratch\ng-bun-test\src\app\app.component.spec.ts:5:14
✗ AppComponent > should render title [4.81ms]
✗ AppComponent > should render title
0 pass
6 fail
Ran 6 tests across 1 files. [424.00ms]
</details>
### Additional information
_No response_
The text was updated successfully, but these errors were encountered:
Addendum: Running the angular test runner via bun run ng test works as expected. As the current angular test setup relies on karma, I'm not sure if there is anything that the bun test runner could do.
What version of Bun is running?
1.1.6+e58d67b46
What platform is your computer?
Microsoft Windows NT 10.0.22631.0 x64
What steps can reproduce the bug?
bun --bun create @angular@latest ng-bun-test --style css --ssr false
bun test
What is the expected behavior?
Tests are successfully executed.
What do you see instead?
The execution crashes with:
Need to call TestBed.initTestEnvironment() first
Full log
``` ➜ bun test bun test v1.1.6 (e58d67b)src\app\app.component.spec.ts:
1995 | * @internal strip this from published d.ts files due to
1996 | * microsoft/TypeScript#36216
1997 | */
1998 | get compiler() {
1999 | if (this._compiler === null) {
2000 | throw new Error(
Need to call TestBed.initTestEnvironment() first
);^
error: Need to call TestBed.initTestEnvironment() first
at compiler (D:\scratch\ng-bun-test\node_modules@angular\core\fesm2022\testing.mjs:2000:19)
at configureTestingModule (D:\scratch\ng-bun-test\node_modules@angular\core\fesm2022\testing.mjs:1903:9)
at D:\scratch\ng-bun-test\src\app\app.component.spec.ts:6:11
at D:\scratch\ng-bun-test\src\app\app.component.spec.ts:5:14
✗ AppComponent > should create the app [2.67ms]
✗ AppComponent > should create the app
1995 | * @internal strip this from published d.ts files due to
1996 | * microsoft/TypeScript#36216
1997 | */
1998 | get compiler() {
1999 | if (this._compiler === null) {
2000 | throw new Error(
Need to call TestBed.initTestEnvironment() first
);^
error: Need to call TestBed.initTestEnvironment() first
at compiler (D:\scratch\ng-bun-test\node_modules@angular\core\fesm2022\testing.mjs:2000:19)
at configureTestingModule (D:\scratch\ng-bun-test\node_modules@angular\core\fesm2022\testing.mjs:1903:9)
at D:\scratch\ng-bun-test\src\app\app.component.spec.ts:6:11
at D:\scratch\ng-bun-test\src\app\app.component.spec.ts:5:14
✗ AppComponent > should have the 'ng-bun-test' title [3.71ms]
✗ AppComponent > should have the 'ng-bun-test' title
1995 | * @internal strip this from published d.ts files due to
1996 | * microsoft/TypeScript#36216
1997 | */
1998 | get compiler() {
1999 | if (this._compiler === null) {
2000 | throw new Error(
Need to call TestBed.initTestEnvironment() first
);^
error: Need to call TestBed.initTestEnvironment() first
at compiler (D:\scratch\ng-bun-test\node_modules@angular\core\fesm2022\testing.mjs:2000:19)
at configureTestingModule (D:\scratch\ng-bun-test\node_modules@angular\core\fesm2022\testing.mjs:1903:9)
at D:\scratch\ng-bun-test\src\app\app.component.spec.ts:6:11
at D:\scratch\ng-bun-test\src\app\app.component.spec.ts:5:14
✗ AppComponent > should render title [4.81ms]
✗ AppComponent > should render title
0 pass
6 fail
Ran 6 tests across 1 files. [424.00ms]
The text was updated successfully, but these errors were encountered: