Prevent uncaught errors to make test fails when they are expected and are fired during template effects flush

pull/16171/head
raythurnvoid 3 months ago
parent 997ccefea9
commit 625530168f

@ -450,13 +450,14 @@ async function run_test_variant(
'Expected component to unmount and leave nothing behind after it was destroyed'
);
// TODO: This seems useless, unhandledRejection is only triggered on the next task
// by which time the test has already finished and the next test resets it to null above
// uncaught errors like during template effects flush
if (unhandled_rejection) {
if (!config.expect_unhandled_rejections) {
throw unhandled_rejection; // eslint-disable-line no-unsafe-finally
}
}
}
}
} catch (err) {
if (config.runtime_error) {
assert.include((err as Error).message, config.runtime_error);

Loading…
Cancel
Save