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
I've this weird issue with jasmine testing framework and bluebird: it sometimes (not consistently) produce errors in the console log like this one:
Unhandled rejection Error: dummy
at UserContext.<anonymous> (/home/mastro/ws/my-project-path/spec/unit/logic.spec.js:246:89)
at UserContext.arguments.(anonymous function) (/home/mastro/ws/my-project-path/node_modules/jasmine-promises/dist/jasmine-promises.js:35:30)
at attempt (/home/mastro/ws/platform/nsp-gamification-loyalty-services/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:4297:26)
at QueueRunner.run (/home/mastro/ws/platform/nsp-gamification-loyalty-services/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:4217:20)
at Timeout.runNext [as _onTimeout] (/home/mastro/ws/platform/nsp-gamification-loyalty-services/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:4257:20)
at tryOnTimeout (timers.js:228:11)
at Timer.listOnTimeout (timers.js:202:5)
Those are actually printed in the logs but do not make the test fail. In fact the test succeed, a test exhibiting the issue may look something like this:
it('should throw if the check of `type` and `config` throws',()=>{spyOn(actionHandler,'validateActionConfig').and.returnValue(Promise.reject(newError('dummy')));returnsut.createAction(principal,action).then(()=>{fail('Promise rejection expected, instead fulfilled');}).catch((err)=>{expect(actionHandler.validateActionConfig).toHaveBeenCalled();expect(err.message).toBe('dummy');});});
This test check our function createAction forward any rejectiong error from the call to actionHandler.validateActionConfig() by returning a rejection promise when the function is called.
That promise is then catched, as you can see, and we also check the error is exactly the one throw there. So the promise IS catched, but somehow it is detected as uncatched.
Furthermore this is not an on/off problem. Some test randomly exhibit this behavior, some never do.
I'm not sure if the issue here is on the jasmine or bluebird side. (I posted this same thing on petkaantonov/bluebird#493)
Can you shed some light on what's possibly going on?
Thanks!
I've this weird issue with jasmine testing framework and bluebird: it sometimes (not consistently) produce errors in the console log like this one:
Those are actually printed in the logs but do not make the test fail. In fact the test succeed, a test exhibiting the issue may look something like this:
This test check our function
createAction
forward any rejectiong error from the call toactionHandler.validateActionConfig()
by returning a rejection promise when the function is called.That promise is then catched, as you can see, and we also check the error is exactly the one throw there. So the promise IS catched, but somehow it is detected as uncatched.
Furthermore this is not an on/off problem. Some test randomly exhibit this behavior, some never do.
I'm not sure if the issue here is on the jasmine or bluebird side. (I posted this same thing on petkaantonov/bluebird#493)
Can you shed some light on what's possibly going on?
Thanks!
related dependencies
and...
PS: I'm not sure if jasmine-npm is the right place to post this issue or if this is for core jasmine, I decided to go specific to my environment.
The text was updated successfully, but these errors were encountered: