Пример
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
Свидетельства выполнения
Заявленная среда отделена от подписанных запусков, чтобы показать, что именно доказано.
Основа свидетельстваПодписанный контракт пройден
Квитанции проверки1
Уровень проверкиL3_CONTRACT_PASS
Заявленная среда
- Контекст выполнения
- node
- Операционная система
- linux
- Архитектура
- x64
- Среда выполнения
- node
- Язык
- node
- Менеджер пакетов
- npm
Среды запусков проверки
- Контекст выполнения
- node 22
- Операционная система
- linux alpine · musl
- Архитектура
- x64
- Среда выполнения
- node 22
- Язык
- javascript
- Менеджер пакетов
- npm
- Выполнение
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17
Кейс
- Цель
- 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
- Пакеты
-
vitest 4.1.10
- Окружение
- node
- Создан
- 2026-08-17T11:56:17Z
Контракт
- 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['--']
Файлы
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Скачать артефакт с исходным кодом (tar.gz)
Исходный сидер
csx-seed
Квитанции проверки
- node 22 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9