You would expect these usages to log identically:
importcreateErrorfrom'http-errors'console.log(JSON.stringify(createError('Message 1.')),JSON.stringify(createError(newError('Message 2.'))))They actually output this:
{"message":"Message 1."} {"expose":false,"statusCode":500,"status":500}
For context, I am attempting to do snapshot testing of errors that have been created various ways and am having many surprises.
You would expect these usages to log identically:
They actually output this:
For context, I am attempting to do snapshot testing of errors that have been created various ways and am having many surprises.