The unit tests that are meant to confirm that errors have been thrown result in false positives when no error has been thrown because the expect statement is only hit when errors are thrown.
test('throws an error if a source file is not found', async () => {
try {
await render({
file: 'nonexistant.scss',
});
} catch (err) {
// if there is no error, this block is never reached ...
expect(err.message).toContain('not found');
}
});
We could probably update the test to look something like this.
test('throws an error if a source file is not found', async () => {
let errorMessage = '';
try {
await render({
file: 'nonexistant.scss',
});
} catch (err) {
errorMessage = err.message;
} finally {
expect(errorMessage).toContain('not found');
}
});
The unit tests that are meant to confirm that errors have been thrown result in false positives when no error has been thrown because the expect statement is only hit when errors are thrown.
We could probably update the test to look something like this.