Skip to content
Advertisement

Tag: node-assert

How to assert that function throws with a specific error message

I’m using Node v18 ( with the built-in testrunner) and the package assert/strict to test that a function call throws an error with a custom error message. I think my code should look like Unfortunately I get the following error error: ‘The “error/message” argument is ambiguous. The error message “content of error.message goes here” is identical to the message.’ I

Advertisement