Const
Assertion for testing if an Error has a message matching a regular expression.
expect( new Error('Error: something went wrong'), 'to have message matching', /something/,); // passesexpect(new Error('All good'), 'to have message matching', /error/i); // fails Copy
expect( new Error('Error: something went wrong'), 'to have message matching', /something/,); // passesexpect(new Error('All good'), 'to have message matching', /error/i); // fails
Assertion for testing if an Error has a message matching a regular expression.