Skip to content

Conversation

@LayZeeDK
Copy link
Member

@LayZeeDK LayZeeDK commented Nov 1, 2025

Add comprehensive test coverage for all move-file generator options:

  • MOVE-PROJECT-DIR: Tests projectDirectory option for explicit path
  • MOVE-DERIVE-DIR: Tests deriveProjectDirectory and mutual exclusivity
  • MOVE-SKIP-EXPORT: Tests skipExport to prevent index updates
  • MOVE-SKIP-FORMAT: Tests skipFormat to preserve formatting
  • MOVE-UNICODE: Tests allowUnicode for Unicode filenames
  • MOVE-REMOVE-EMPTY: Tests removeEmptyProject cleanup behavior

Each scenario includes focused assertions to verify critical invariants such as file relocation, import/export rewrite behavior, and project removal where applicable.

Closes #322

🤖 Generated with Claude Code

Add comprehensive test coverage for all move-file generator options:

- MOVE-PROJECT-DIR: Tests projectDirectory option for explicit path
- MOVE-DERIVE-DIR: Tests deriveProjectDirectory and mutual exclusivity
- MOVE-SKIP-EXPORT: Tests skipExport to prevent index updates
- MOVE-SKIP-FORMAT: Tests skipFormat to preserve formatting
- MOVE-UNICODE: Tests allowUnicode for Unicode filenames
- MOVE-REMOVE-EMPTY: Tests removeEmptyProject cleanup behavior

Each scenario includes focused assertions to verify critical invariants
such as file relocation, import/export rewrite behavior, and project
removal where applicable.

Closes #322

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Lars Gyrup Brink Nielsen <[email protected]>
github-actions bot and others added 2 commits November 1, 2025 19:58
Refactor generator option scenarios to follow the new cost-efficient
end-to-end test plan architecture:

- Move tests from workspace.spec.ts to workspace.suite.spec.ts
- Implement 6 generator option scenarios using shared workspace pattern
- Use pre-allocated libraries (lib-d through lib-o) to avoid setup overhead
- Follow existing patterns with infrastructure fast-fail and inline assertions

Scenarios implemented:
- MOVE-PROJECT-DIR: projectDirectory option for explicit paths
- MOVE-DERIVE-DIR: deriveProjectDirectory flag
- MOVE-SKIP-EXPORT: skipExport to prevent index updates
- MOVE-SKIP-FORMAT: skipFormat to preserve unformatted code
- MOVE-UNICODE: allowUnicode for Unicode filenames
- MOVE-REMOVE-EMPTY: removeEmptyProject cleanup behavior

Related to #322

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Lars Gyrup Brink Nielsen <[email protected]>
Replace all error-throwing patterns (if-throw) with Jest expect
assertions for better test reporting and consistency:

- existsSync checks: expect(existsSync(...)).toBe(true/false)
- String content checks: expect(content).toContain(...) / not.toContain(...)
- Defined checks: expect(value).toBeDefined()

Updated 8 generator option scenarios with 21 total assertions.

Co-authored-by: Lars Gyrup Brink Nielsen <[email protected]>
LayZeeDK

This comment was marked as resolved.

@claude

This comment was marked as duplicate.

Create `toExistOnFilesystem()` custom matcher to provide better error
messages when asserting file existence in e2e tests.

Benefits:
- Clear error messages showing exact path and existence status
- More readable assertions: expect(path).toExistOnFilesystem()
- Follows Jest best practices for custom matchers

Replaced 5 existsSync assertions across MOVE-SMALL, APP-TO-LIB,
and MOVE-REMOVE-EMPTY scenarios.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Lars Gyrup Brink Nielsen <[email protected]>
@LayZeeDK

This comment was marked as resolved.

@claude

This comment was marked as resolved.

Add explicit type narrowing guards after expect assertions to resolve
TS18048 errors where sharedWorkspace is possibly undefined. This ensures
TypeScript correctly infers the non-null type after the Jest assertion.

Co-authored-by: Lars Gyrup Brink Nielsen <[email protected]>
@LayZeeDK

This comment was marked as resolved.

@claude

This comment was marked as resolved.

Add explicit type guard after expect(appName).toBeDefined() to narrow
the type from string | undefined to string, resolving TypeScript errors
at lines 452 and 457.

Co-authored-by: Lars Gyrup Brink Nielsen <[email protected]>
Replace expect().toBeDefined() + if (!value) return; pattern with
custom assertDefined<T>() function using TypeScript's asserts keyword.

Benefits:
- Single line instead of two
- Better error messages with value name
- Type narrowing via assertion signature
- More idiomatic TypeScript

Co-authored-by: Lars Gyrup Brink Nielsen <[email protected]>
@LayZeeDK LayZeeDK marked this pull request as ready for review November 1, 2025 21:29
Copy link
Member Author

@LayZeeDK LayZeeDK left a comment

Choose a reason for hiding this comment

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

✅ LGTM

@LayZeeDK LayZeeDK merged commit f9aea3b into test/319-adopt-new-end-to-end-test-plan Nov 1, 2025
14 checks passed
@LayZeeDK LayZeeDK deleted the claude/issue-322-20251101-1938 branch November 1, 2025 21:35
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.

2 participants