Skip to content

Move all tests under test/ mirroring src layout - #27

Merged
rafaeelricco merged 1 commit into
mainfrom
rafaeelricco/consolidate-tests-under-test
May 22, 2026
Merged

Move all tests under test/ mirroring src layout#27
rafaeelricco merged 1 commit into
mainfrom
rafaeelricco/consolidate-tests-under-test

Conversation

@rafaeelricco

Copy link
Copy Markdown
Owner

Motivation

Tests were co-located next to source files under src/, while helpers and smoke tests already lived in test/. This PR consolidates every test under test/ with a layout that mirrors src/, so test discovery and tooling config stay in one place.

What's New

Test layout

  • Move 18 src/**/*.test.ts files into test/ (cli/, domain/, infra/, libs/)
  • Relocate smoke coverage to test/cli/smoke.test.ts

Tooling

  • Restrict Vitest discovery to test/**/*.test.ts
  • Add @test/ alias for shared helpers such as run-future and temp-git-repo
  • Include test/**/* in TypeScript typecheck and ESLint coverage

Test fixes

  • Standardize helper imports on @test/helpers/*
  • Fix typecheck issues surfaced by including tests in tsc (e.g. Future.resolve(undefined), Success/Failure narrowing)

Testing & Feedback

  • Confirm pnpm test still reports 20 files / 73 tests
  • Confirm pnpm typecheck and pnpm run lint:ci pass
  • Spot-check that CLI smoke tests still resolve dist/index.js from the new path

If you find any bugs or have recommendations for improvements, please open an issue and assign it to me.

Centralize Vitest discovery, add @test path alias, and include test files in typecheck and lint.
@rafaeelricco
rafaeelricco marked this pull request as ready for review May 22, 2026 22:00

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Critical correctness scan

Reviewed PR #27 (19ffd65) and the parent Vitest refactor (#26, 3f777b8). Scope is test layout, path aliases, and config updates only; no src/ production logic changed in this PR.

Checks run: pnpm test (69 passed), pnpm typecheck, pnpm build.

Findings: No critical correctness issues. The prior import-time CONFIG_DIR/CONFIG_FILE hazard from #26 is already addressed via lazy configDir()/configFile() plus per-test COMMIT_TOOLS_HOME in test/setup.ts.

Below critical bar (not actionable here): Bare commit-tools now defaults to generate instead of help (#26, documented in --help).

Open in Web View Automation 

Sent by Cursor Automation: Find critical bugs

@rafaeelricco
rafaeelricco merged commit e945e24 into main May 22, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant