The toThrow matcher can take either a string or an Error object. If given a string, it tests that if there is a thrown error, the error message includes the given string; if given an Error, however, it tests that the thrown error message completely matches the given error message. In general, the complete message of an error should be tested, not just part of it, because error messages are part of user experience and it's important to verify that the user is seeing the right thing.