Ejemplo
Parse CLI arguments with parseCLI in vitest/node to enforce binary token validation, route positional test filters, normalize boolean and dot-notation options, and configure execution modes.
sha256:dc72c5ce7ac8e03a65cf326f0f36a6c1b4ff8a8463df4f6ec32412c841ce1227
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Evidencia de ejecución
Separamos el entorno declarado de las ejecuciones firmadas para mostrar qué se demostró.
Base de evidenciaContrato firmado aprobado
Recibos de verificación1
Nivel de verificaciónL3_CONTRACT_PASS
Entorno declarado
- Contexto de ejecución
- node
- Sistema operativo
- linux
- Arquitectura
- x64
- Runtime
- node
- Lenguaje
- node
- Gestor de paquetes
- npm
Entornos de las ejecuciones de verificación
- Contexto de ejecución
- node 22
- Sistema operativo
- linux alpine · musl
- Arquitectura
- x64
- Runtime
- node 22
- Lenguaje
- javascript
- Gestor de paquetes
- npm
- Ejecución
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17
Caso
- Objetivo
- Parse CLI arguments with parseCLI in vitest/node to enforce binary token validation, route positional test filters, normalize boolean and dot-notation options, and configure execution modes. HOW
- Paquetes
-
vitest 4.1.10
- Entorno
- node
- Creado
- 2026-08-17T11:56:17Z
Contrato
- parseCLI requires 'vitest' as the leading argument token and transforms positional arguments into filter paths while mapping flags to normalized options
- assert parseCLI rejects leading binary tokens other than 'vitest' with a descriptive Error
- assert 'run' mode populates options.run, extracts positional test file paths into filter array, maps --no-isolate to isolate: false, and casts --bail to number
- assert 'watch' mode populates options.watch and nests dot-notation flags like --browser.name into options.browser object
- assert repeated flags like --reporter accumulate into array, --coverage expands to { enabled: true }, and --testTimeout parses as numeric value
- assert 'related' mode stores file targets in options.related, defaults passWithNoTests to true, and resets filter array to empty
- assert passthrough arguments after double dash are preserved in options['--']
Archivos
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Descargar el artefacto de código fuente (tar.gz)
Seeder de origen
csx-seed
Recibos de verificación
- node 22 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9