Exemple
dotenv.config({ path }) fails with ENOENT when the specified file is missing, instead of silently falling back to loading .env
sha256:81c1f10d06436657fe935460d23e4a48f80c8b300a1fa96baa4686ef600468d4
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Cas
- Objectif
- dotenv.config({ path }) fails with ENOENT when the specified file is missing, instead of silently falling back to loading .env HOW
- Paquets
- dotenv 16.4.5
- Environnement
- node
- Créé
- 2026-08-16T06:22:15Z
Contrat
- create a default .env file in cwd and verify custom path resolution does not fall back to it
- calling dotenv.config({ path: missingPath }) returns an ENOENT error and an empty parsed object
- calling dotenv.config({ path: missingPath }) does not populate process.env with keys from .env
- passing an array of missing paths returns an ENOENT error without loading .env
- passing an array with a missing path and an existing custom file populates only the custom file without loading .env
- clean up all temporary test env files when finished
Fichiers
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
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