Skip to content

test(currencies): cover built dist subpath bundle#171

Merged
dmythro merged 1 commit into
mainfrom
test/currencies-dist-subpath
Jun 14, 2026
Merged

test(currencies): cover built dist subpath bundle#171
dmythro merged 1 commit into
mainfrom
test/currencies-dist-subpath

Conversation

@dmythro

@dmythro dmythro commented Jun 14, 2026

Copy link
Copy Markdown
Member

What

Adds packages/test-js/dist-currencies.test.ts, exercising the built countries-list/currencies subpath bundle (dist/mjs/currencies.js) — which previously shipped with no test at the dist level (the existing index.test.ts only covers the main bundle).

Asserts:

  • the built ESM bundle re-exports currencies, getCurrency, getCurrencyByNumeric
  • its currency keys match the source module
  • getCurrency / getCurrencyByNumeric resolve correctly from the built artifact
  • the currency dataset stays out of the main/IIFE/CJS bundles (guards the opt-in split against accidental bundle-size regressions)

Why

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 (the test script builds first), so the dist artifacts exist in CI.

Copilot AI review requested due to automatic review settings June 14, 2026 19:39
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

A new Bun test file dist-currencies.test.ts is added to the packages/test-js package. It imports both the built dist/mjs/currencies.js bundle and the source currencies module, then performs four categories of assertions: that the bundle re-exports currencies, getCurrency, and getCurrencyByNumeric; that the currencies object keys match the source implementation; that getCurrency('UAH') and getCurrencyByNumeric('840') return the expected currency data; and that the three main distributed bundles (index.iife.js, mjs/index.js, cjs/index.js) do not contain the symbolNative field.

Poem

🐇 A bundle was built, so let's check it's just right,
The currencies live in their opt-in delight.
No symbolNative sneaks into the core,
UAH resolves, and the keys match the store.
Hop along, tests — the dist is secure! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title directly and concisely describes the main change: adding test coverage for the built dist subpath bundle for currencies.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description clearly explains what changes are being made, why they're needed, and provides context about testing the new currencies subpath entry point.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/currencies-dist-subpath

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI 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.

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 currencies entry and asserts expected re-exports.
  • Verifies the built currencies keyset 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.

@dmythro dmythro merged commit 7ea551c into main Jun 14, 2026
3 checks passed
@dmythro dmythro deleted the test/currencies-dist-subpath branch June 14, 2026 21:14
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