Testy / TestyTs

✔️ Modern TypeScript testing framework.
http://testy.github.io
ISC License
123 stars 8 forks source link

The error message for timed out tests is undefined #19

Closed Aboisier closed 5 years ago

Aboisier commented 5 years ago

The error message for timed out tests is undefined.

image

When a test is started, a timeout is also started concurrently.

setTimeout(() => reject('Test has timed out.'), timeout);

When this error is caught, the error is a string and not an error. The problem is that the error message is set like this by the test runner:

report = new FailedTestReport(test.name, err.message, 0);

We should check whether the error is a string or an object.

The following test will also fail with an undefined error message:

@Test()
async test() {
    await new Promise((resolve, reject) => reject('Failure!'));
}
Aboisier commented 5 years ago

Fixed in #20