Exemple
Parameterize tests with an empty data array.
sha256:0ac6bc6acb151cfaea339a37fcb25239580e5f542c52fbd2fd83ebf290636e90
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Cas
- Objectif
- Parameterize tests with an empty data array. HOW
- Paquets
- jest 30.4.2
- Environnement
- node
- Créé
- 2026-08-17T01:56:49Z
Ce que l'on suppose souvent
Passing an empty array to test.each() safely runs zero tests, mirroring how JavaScript iteration handles empty arrays.
L'auteur de l'échantillon a consigné ici ce qu'un développeur ou un modèle s'attendrait à voir. Le contrat ci-dessous est ce qui s'est réellement exécuté.
Contrat
- Calling test.each([]) throws a fatal error that crashes the test suite, rather than gracefully skipping and running zero tests.
Fichiers
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test.js
- test/contract.mjs
- trap.test.js
Télécharger l'artefact vérifié (tar.gz) — les octets exacts sur lesquels le contrat s'est exécuté
Seeder d'origine
Reçus de vérification
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-16 · ed25519:d91480838ac982c9