karma-runner / karma-jasmine

A Karma plugin - adapter for Jasmine testing framework.
MIT License
542 stars 163 forks source link

Uncaught (in promise) Type Error: Cannot read properties of null (reading 'jasmineMessage') #323

Closed plarner30 closed 2 years ago

plarner30 commented 2 years ago

Since upgrading an Aurelia project to webpack 5, and using the latest dependencies for testing i am consistently getting this error after a random number of tests which halts the remainder of the tests execution until it displays a "Disconnected , because no message in 30000 ms" message.

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'jasmineMessage') at next (jasmine.js:8036:62) at jasmine.js:7941:9

The relevant lines from jasmine in the call stack above are https://github.com/jasmine/jasmine/blob/68eaa64c31d44cd9daf7c991857ff8d36818f25c/lib/jasmine-core/jasmine.js#L8036 https://github.com/jasmine/jasmine/blob/68eaa64c31d44cd9daf7c991857ff8d36818f25c/lib/jasmine-core/jasmine.js#L7941

Does any one have any ideas why this is happening? Apologies not certain if this is a jasmine-core issue please let me know if more suitable.

plarner30 commented 2 years ago

Ive narrowed this down to any use of the line beforeEach(async () => {}),

beforeEach(() => {}) is ok

plarner30 commented 2 years ago

Leaving this open for now, but i have found a small adjustment in jasmine-core seems to fix my issue: https://github.com/jasmine/jasmine/issues/1974

plarner30 commented 2 years ago

Closing as this was down to me having a partial jest install interfering with jasmine, for more info see above issue