test(currencies): cover built dist subpath bundle#171
Conversation
📝 WalkthroughWalkthroughA new Bun test file Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds Bun tests to validate the published/built countries-list/currencies subpath bundle works as intended and remains opt-in (doesn’t inflate the default bundles), aligning test coverage with the new public entry point.
Changes:
- Adds a new dist-level test that imports the built ESM
currenciesentry and asserts expected re-exports. - Verifies the built
currencieskeyset matches the source module. - Guards against accidental inclusion of the currency dataset in the main/IIFE/CJS bundles by scanning built bundle contents.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What
Adds
packages/test-js/dist-currencies.test.ts, exercising the builtcountries-list/currenciessubpath bundle (dist/mjs/currencies.js) — which previously shipped with no test at the dist level (the existingindex.test.tsonly covers the main bundle).Asserts:
currencies,getCurrency,getCurrencyByNumericgetCurrency/getCurrencyByNumericresolve correctly from the built artifactWhy
The currencies subpath is a new public entry point; this locks in that the published artifact actually works and stays separated from the default bundle. Runs after
bun run build(thetestscript builds first), so the dist artifacts exist in CI.