Skip to content

Exclude test-utils.ts from package build output - #2327

Open
ayushsingh82 wants to merge 1 commit into
canton-network:mainfrom
ayushsingh82:ayush/exclude-test-utils-from-build-1899
Open

Exclude test-utils.ts from package build output#2327
ayushsingh82 wants to merge 1 commit into
canton-network:mainfrom
ayushsingh82:ayush/exclude-test-utils-from-build-1899

Conversation

@ayushsingh82

Copy link
Copy Markdown
Contributor

Summary

core/splice-client/dist/test-utils.d.ts (and core/ledger-client's equivalent) are checked into git. The shared tsconfig.base.json exclude list already catches *.test.ts, *.spec.ts, and __tests__/**, but not a file literally named test-utils.ts.

Added **/test-utils.ts to the shared exclude.

Deliberately did not exclude fixtures.ts/mocks.ts more broadly: core/wallet-test-utils intentionally exports fixtures.ts as part of its real public API (main/module/types all point at dist/index.*, and index.ts does export { test, expect } from './fixtures.js'), so a blanket filename-based exclude there would break that package's actual build output.

Fixes #1899

Test plan

  • Rebuilt core/splice-client's declarations twice: with this change, test-utils.d.ts/.d.ts.map are absent from dist/; reverting the change and rebuilding again, they reappear -- confirms this fix is what causes the difference, not something else
  • Confirmed via grep that no file anywhere in the repo imports from a test-utils.ts path, so nothing depends on it being in the build output

core/splice-client/dist/test-utils.d.ts and core/ledger-client's
equivalent are checked into git: the shared exclude list catches
*.test.ts/*.spec.ts/__tests__/** but not a file literally named
test-utils.ts. Confirmed by rebuilding core/splice-client's
declarations with and without this change -- test-utils.d.ts only
disappears with the fix.

Deliberately not excluding fixtures.ts/mocks.ts: core/wallet-test-utils
intentionally exports fixtures.ts as part of its real public API, so a
blanket filename exclude there would break its build.

Fixes canton-network#1899

Signed-off-by: ayushsingh82 <ayushsinghmi711@gmail.com>
@ayushsingh82

Copy link
Copy Markdown
Contributor Author

@rukmini-basu-da whenever you have a chance, would appreciate a look at this one.

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.

Exclude testing code from builds

1 participant