simontonsoftware / s-libs

A collection of libraries for any of javascript, rxjs, or angular.
MIT License
43 stars 5 forks source link

[ng-dev] ctx.run() swallows thrown exceptions #55

Closed jritzi closed 2 years ago

jritzi commented 2 years ago

Uncaught exceptions in a ctx.run() block are silently ignored and do not cause the test to fail. For example, this test passes without printing the error to the console:

it('should fail', () => {
  ctx.run(() => {
    throw new Error('error');
  });
});

The same test fails when removing ctx.run(), so it should continue to fail (and log the error) when done using a ComponentContext.

ersimont commented 2 years ago

Looks like this was already fixed in some previous version. I added a test to make sure it stays fixed.