Answer the question
In order to leave comments, you need to log in
How to write a test to detect an error in an asynchronous function?
How to write a test to detect an error in an asynchronous function?
This option doesn't work:
assert.throw(async function() {
await new Application().load('not-exists/path/to/app');
});
try {
await new Application().load('not-exists/path/to/app');
} catch (e) {
assert.throw(function() {
throw e;
});
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question