Problem
The default check function (equals) is deep — it's defined as deep(shallowEquals()). But when using the object shorthand to customize check behavior, deep previously defaulted to false (no default was set in the destructuring). This creates a usability cliff: the moment a user customizes check via object shorthand, they silently lose deep comparison unless they explicitly add deep: true.
Example
// Default check — deep comparison, works on nested objects
{
run: () => ({ a: { b: 1 } }),
expect: { a: { b: 1 } },
// ✅ passes — default equals is deep
}
// Object shorthand — loses deep comparison
{
run: () => ({ a: { b: 1 } }),
expect: { a: { b: 1 } },
check: { subset: true },
// ❌ fails — shallowEquals can't compare objects by structure
}
// Must explicitly opt in
{
run: () => ({ a: { b: 1 } }),
expect: { a: { b: 1 } },
check: { subset: true, deep: true },
// ✅ passes
}
Docs mismatch
docs/define/README.md states deep defaults to false. PR #153 changed the code to default to true, which matches user expectations (consistent with the default equals check) but contradicts the docs.
Proposed fix
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
Problem
The default
checkfunction (equals) is deep — it's defined asdeep(shallowEquals()). But when using the object shorthand to customize check behavior,deeppreviously defaulted tofalse(no default was set in the destructuring). This creates a usability cliff: the moment a user customizes check via object shorthand, they silently lose deep comparison unless they explicitly adddeep: true.Example
Docs mismatch
docs/define/README.mdstatesdeepdefaults tofalse. PR #153 changed the code to default totrue, which matches user expectations (consistent with the defaultequalscheck) but contradicts the docs.Proposed fix
deeptotruein the object shorthand (as PR Lazy property resolution and accessor support (#152) #153 already does)docs/define/README.mdto documentdeepdefaulting totrueCo-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com