Skip to content

feat(scenarios): format + 5 initial scenarios + package config#39

Merged
sepehr-safari merged 1 commit into
mainfrom
feat/scenarios-package
Jul 7, 2026
Merged

feat(scenarios): format + 5 initial scenarios + package config#39
sepehr-safari merged 1 commit into
mainfrom
feat/scenarios-package

Conversation

@sepehr-safari

Copy link
Copy Markdown
Member

Summary

Creates the @ocpp-debugkit/scenarios package with 5 initial scenarios, scenario registry, and tests.

Closes #23

Changes

New package: packages/scenarios/

  • src/index.ts — scenario registry with getScenario() lookup, exports all 5 scenarios
  • src/__scenarios__/station-offline.json — station offline during active session
  • src/__scenarios__/unexpected-stop-reason.json — stop transaction with unexpected reason (parser/timeline-only fixture)
  • src/index.test.ts — 21 tests
  • package.json — publish-ready (access: public, sideEffects: false)
  • tsconfig.json

5 Scenarios

  1. normal-session — no expected failures
  2. failed-auth — expects FAILED_AUTHORIZATION
  3. connector-fault — expects CONNECTOR_FAULT
  4. station-offline — expects STATION_OFFLINE_DURING_SESSION
  5. unexpected-stop-reason — parser/timeline-only fixture (expectedFailures: [])

Test Coverage

  • Registry tests (exports count, names, individual exports, getScenario() lookup)
  • Expected failures alignment with v0.1 detection rules
  • Engine integration (each scenario run through parseTracebuildSessionTimelinedetectFailures)
  • Synthetic data policy (SYNTHETIC markers, no UUID patterns, ocppVersion 1.6)

Verification

  • pnpm lint — ✅
  • pnpm typecheck — ✅
  • pnpm test — ✅ (168 tests)
  • pnpm build — ✅
  • pnpm format:check — ✅

- Scenario registry with getScenario() lookup
- 5 scenarios: normal-session, failed-auth, connector-fault,
  station-offline, unexpected-stop-reason
- Each scenario's expectedFailures aligns with v0.1 detection rules
- 21 tests (registry, engine integration, synthetic data policy)

Closes #23
@sepehr-safari sepehr-safari added this to the v0.1.0 — Inspector MVP milestone Jul 7, 2026
@sepehr-safari sepehr-safari added type:feature New feature or enhancement package:scenarios @ocpp-debugkit/scenarios labels Jul 7, 2026
@sepehr-safari sepehr-safari merged commit 17c2aa0 into main Jul 7, 2026
1 check passed
@sepehr-safari sepehr-safari deleted the feat/scenarios-package branch July 7, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package:scenarios @ocpp-debugkit/scenarios type:feature New feature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(scenarios): format + 5 initial scenarios + package config

1 participant