Skip to content

test(e2e): init-e2e-flags checks CLI existence, not freshness #317

Description

@dean0x

Problem

tests/init-e2e-flags.test.ts:105 uses existsSync(CLI_PATH) to gate the e2e test suite, which checks whether dist/cli.js exists, not whether it is fresh. A dist/cli.js built from any prior commit satisfies the gate, so running npx vitest without npm run build:cli first silently exercises stale code while tests report green.

Current Status

Suggested Sequencing

Fixing this changes the suite-wide build-freshness contract — scoped outside PR #316's blast radius. Suggested approaches:

  1. Replace existence check with freshness check (mtime(dist/cli.js) > mtime(newest src/**/*.ts))
  2. Have e2e suite build into a temp dir itself (ensures freshness by construction)

Acceptance Criteria

  • E2E test gate checks CLI freshness, not existence
  • npx vitest without prior npm run build:cli either fails or rebuilds automatically
  • Stale code is never silently exercised
  • All existing e2e tests pass with new gate

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtTechnical debt items to address

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions