I have a test case where I would like the test case to fail or end when the error code is 500. But the test.fail() does not immediately stop the test case.
if (msg.type() === 'error'){
console.log(`Error text: "${msg.text()}"`)
}
if(msg.text()=== "Failed to load resource: the server responded with a status of 500 ("){
test.fail()
}
})
what should I add more to this code. I want the test to fail as soon as it sees a 500 error message