Asserts that an Error instance has a given message:

expect(new Error('foobar'), 'to have message', 'foobar');

In case of a failing expectation you get the following output:

expect(new Error('foobar'), 'to have message', 'barfoo');
expected Error('foobar'to have message 'barfoo'
  
expected 'foobar' to satisfy 'barfoo'
 
-
foobar
+
barfoo