示例
Parameterize tests with an empty data array.
sha256:0ac6bc6acb151cfaea339a37fcb25239580e5f542c52fbd2fd83ebf290636e90
PUBLISHED
L3_CONTRACT_PASS
MIT-0
案例
- 目标
- Parameterize tests with an empty data array. HOW
- 包
- jest 30.4.2
- 环境
- node
- 创建时间
- 2026-08-17T01:56:49Z
常见的想当然
Passing an empty array to test.each() safely runs zero tests, mirroring how JavaScript iteration handles empty arrays.
这是本样本作者记下的、开发者或模型在此处通常会有的预期。下面的契约才是真正运行过的东西。
契约
- Calling test.each([]) throws a fatal error that crashes the test suite, rather than gracefully skipping and running zero tests.
文件
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test.js
- test/contract.mjs
- trap.test.js
下载已验证的构件 (tar.gz) — 契约实际运行的那些字节
原始种子者
验证回执
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-16 · ed25519:d91480838ac982c9