New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to angular 10 failing #421
Comments
Hi, do you have the example of your test ? |
I presume you mean the test file, see below, it fails on the line with the return (we used to have a async there; and changed it to then to see if it would solve it, but it didn't. describe('Test Dynamic Calculation', () => { beforeAll(async(async () => {
})); afterAll(() => resetTestingModule()); beforeEach(() => {
}); let sheetService: SheetService; //https://docs.google.com/document/d/1zaBOjPAYA0V5W-STklriopgcjXLT3tlcF5B6UBJcpFI/edit#heading=h.kf90avxgw7gv
}); |
Oops this is quite a big test file. Is it possible for you to create a small similar example ? In general, look at the stack trace look like there is something goes wrong with async test. |
I stripped it out as far as I could. it fails on the async function to firebase: import { async, TestBed } from '@angular/core/testing'; describe('Test Dynamic Calculation', () => { beforeAll(async(async () => {
})); afterAll(() => resetTestingModule()); beforeEach(async () => {
}); it('Example 0', () => { }); |
If you put async code in |
Sooo, update: yes, the call gives issues in the 'it' and in the 'beforeAll' as well. And an await to something else works: So it seems to be related to something that changed during the update for Firebase/AngularFire? |
Hmm I suspect so, the [ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING] is a nodejs error, and isn鈥檛 related to the preset. The acro-companion\node_modules\src\auth\auth.ts:58:52 is quite suspected though, is this from Firebase/AngularFire ? |
Yep, it's from firebase. |
馃悰 Bug Report
When upgrading to angular 10, with all the latest libraries in package.json, with node 12, 13 and 14; and also after remaking the project so that it's the same as this example: https://github.com/ahnpnl/jest-angular ; we still get:
Error: Uncaught [TypeError: A dynamic import callback was not specified.] at reportException (C:\Users\Rubenn\AC\acro-companion\node_modules\jest-environment-jsdom\node_modules\jsdom\lib\jsdom\living\helpers\runtime-script-errors.js:62:24) at Timeout.task [as _onTimeout] (C:\Users\Rubenn\AC\acro-companion\node_modules\jest-environment-jsdom\node_modules\jsdom\lib\jsdom\browser\Window.js:396:9) at listOnTimeout (internal/timers.js:551:17) at processTimers (internal/timers.js:494:7) TypeError [ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING]: A dynamic import callback was not specified. at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:31:9) at C:\Users\Rubenn\AC\acro-companion\node_modules\src\auth\auth.ts:58:52 at ZoneDelegate.invoke (C:\Users\Rubenn\AC\acro-companion\node_modules\zone.js\dist\zone.js:386:30) at ProxyZoneSpec.onInvoke (C:\Users\Rubenn\AC\acro-companion\node_modules\zone.js\dist\proxy.js:117:43) at ZoneDelegate.invoke (C:\Users\Rubenn\AC\acro-companion\node_modules\zone.js\dist\zone.js:385:36) at Zone.run (C:\Users\Rubenn\AC\acro-companion\node_modules\zone.js\dist\zone.js:143:47) at NgZone.runOutsideAngular (C:\Users\Rubenn\AC\packages\core\src\zone\ng_zone.ts:227:50) at SwitchMapSubscriber.project (C:\Users\Rubenn\AC\acro-companion\node_modules\src\auth\auth.ts:58:28) at SwitchMapSubscriber._next (C:\Users\Rubenn\AC\acro-companion\node_modules\rxjs\src\internal\operators\switchMap.ts:123:21) at SwitchMapSubscriber.Subscriber.next (C:\Users\Rubenn\AC\acro-companion\node_modules\rxjs\src\internal\Subscriber.ts:99:12) { code: 'ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING' }
The jest team asked to post this here (see ticket with them:
jestjs/jest#10251 (comment) )
It only seems to happen if our beforeEach() method has asynchronous code:
`
beforeEach(() => {
ed = TestBed.inject(ExerciseData);
`
We've been searching for quite some time but don't find the reason. Probably we're overlooking something but we don't seem to find it. Any ideas?
envinfo
The text was updated successfully, but these errors were encountered: