Skip to content

Exclude test files from build and runner#13

Merged
gndelia merged 2 commits intomasterfrom
tests-run-from-build-and-shipped
Mar 26, 2026
Merged

Exclude test files from build and runner#13
gndelia merged 2 commits intomasterfrom
tests-run-from-build-and-shipped

Conversation

@gndelia
Copy link
Copy Markdown
Contributor

@gndelia gndelia commented Mar 26, 2026

Summary

  • Exclude *.test.ts and *.test.tsx from tsconfig.json so tsc no longer compiles test files into _esm/
  • Add exclude to vitest config so test discovery skips _esm/ build output

No need to generate a release for this

Closes #11

Test plan

  • npm run build produces no *.test.* files in _esm/
  • npx vitest run only runs tests from src/, not _esm/
  • All 24 tests pass

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 26, 2026 13:28
@gndelia gndelia self-assigned this Mar 26, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses issue #11 by preventing tests from being compiled into the _esm/ build output and by ensuring Vitest doesn’t discover/run tests from _esm/ after a local build.

Changes:

  • Update tsconfig.json to exclude src/**/*.test.ts(x) from TypeScript compilation (so tests aren’t emitted into _esm/ / _types/).
  • Update vitest.config.ts to exclude _esm/ from test discovery.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
vitest.config.ts Adds a Vitest exclude pattern to skip tests under _esm/.
tsconfig.json Excludes *.test.ts(x) from the TS project so build output won’t include tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gndelia gndelia merged commit 370e915 into master Mar 26, 2026
15 checks passed
@gndelia gndelia deleted the tests-run-from-build-and-shipped branch March 26, 2026 14:17
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.

Tests are running in the local build folder

4 participants