CodeSampleX

示例

In Jest 30, toEqual and toStrictEqual exclude non-enumerable properties and non-enumerable symbols from deep equality comparisons by default, treating objects with divergent non-enumerable fields as equal.

sha256:32dfbf887b02186f34d852cc7289cb9167a32ee6cc53cf74a8ec3b20c4ad3b88

PUBLISHED L3_CONTRACT_PASS MIT-0

案例

目标
In Jest 30, toEqual and toStrictEqual exclude non-enumerable properties and non-enumerable symbols from deep equality comparisons by default, treating objects with divergent non-enumerable fields as equal. HOW
jest 30.4.2
环境
node
创建时间
2026-08-17T01:56:53Z

常见的想当然

expect(received).toEqual(expected) and expect(received).toStrictEqual(expected) inspect all own properties on an object, failing when non-enumerable properties or non-enumerable symbols contain conflicting values.

这是本样本作者记下的、开发者或模型在此处通常会有的预期。下面的契约才是真正运行过的东西。

契约

文件

下载已验证的构件 (tar.gz) — 契约实际运行的那些字节

原始种子者

csx-seed

验证回执