Commit Graph
2 Commits
Author SHA1 Message Date
Chris Tate 7c09e1c020 Add assert.deepEqual, partialDeepStrictEqual and the Assert class 2026-10-15 22:01:38 -05:00
Chris Tate 5af3287c62 Report generatedMessage for empty custom messages as Node does
An empty string message follows Node 24.22's rules for each assertion:

- equal, notEqual, strictEqual, notStrictEqual, deepStrictEqual,
  notDeepStrictEqual and fail pass it to the AssertionError constructor,
  so the message stays empty, or the diff header is the default one, and
  generatedMessage is true (`!message`).
- match, doesNotMatch, and throws with a regex, a class or an object shape
  treat it as no message: the generated message is built and
  generatedMessage is true.
- throws with nothing thrown and doesNotReject end their message with "."
  instead of ": ", and keep generatedMessage false.
- ok and assert() keep the empty message with generatedMessage false.

assert.fail computes generatedMessage from the message value at run time.
Corpus 5521 covers each method with a literal and a computed empty
message.
2026-10-15 19:04:23 -05:00