With t.skipJsError()
I can easily skip (specified) JS errors.
Is there also the possibility to expect, if a certain error has been thrown? That would mean, that if the error is not thrown, the test will not succeed.
Thanks!
You can use a try-catch construction. For example:
fixture('My fixture')
.page('./index.html');
test('First test', async t => {
try {
await t.click('button');
} catch (e) {
await t.expect(e.errStack).contains('Error:');
}
});