Below there are two assertions that the content inside the function will throw. They should not be passing, they should be throwing an assertion error, because the string error message is not the same as the one being throw. I don't know if this is an issue with Node.js / babel or something obvious I'm doing wrong. I believe I've gotten this working as I've expected in the past.
assert.throws(function () {
throw new Error('hi')
}, Error, 'bye')
assert.throws(function () {
throw new Error('hi')
}, 'bye')
Aucun commentaire:
Enregistrer un commentaire