Skip to content

test: add parseId coverage to smoke tests - #28

Merged
suhailopensource merged 3 commits into
suhailopensource:mainfrom
Nityam43:fix/smoke-tests-parseid
Sep 4, 2026
Merged

suhailopensource merged 3 commits into
suhailopensource:mainfrom
Nityam43:fix/smoke-tests-parseid

Conversation

@Nityam43

@Nityam43 Nityam43 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

📝 Summary

Expands the repository's cross-runtime smoke tests to include validation for the parseId function. This ensures that the newest public API is actively exercised in CI across Node.js (both ESM and CJS) and browser environments prior to release.

🛠️ Changes Made

  • Updated Test Suites: Added parseId assertions to scripts/smoke.mjs, scripts/smoke.cjs, and scripts/browser-smoke.html.
  • Added Core Assertions: Taught the tests to explicitly check three conditions:
    • The Happy Path (Round-trip): Verifies that parsing a valid, generated ID accurately splits it into { prefix, id }.
    • Missing Separator: Ensures string inputs without a separator (e.g., "nosep") safely return undefined.
    • Invalid Input Type: Confirms non-string inputs (e.g., null) are handled safely and return undefined.

✅ Verification

All local tests and CI checks pass cleanly:

  • npm run smoke (Validated across Node ESM and CJS)
  • npm run verify (Prettier formatting, TypeScript typings, and all CI checks are perfectly green)

Closes #20

@suhailopensource

suhailopensource commented Sep 4, 2026 •

Copy link
Copy Markdown
Owner

@Nityam43 the extra spaces in the PR in smoke file scripts/browser-smoke.html is unecessary . DO remove those . Thank you .

@suhailopensource

Copy link
Copy Markdown
Owner

Other than That the Code looks good to me . Thanks. Do star the Repo.

@Nityam43

Nityam43 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Done! I've removed the extra spaces in browser-smoke.html. Let me know if everything looks good now! 🚀

@suhailopensource

Copy link
Copy Markdown
Owner

@Nityam43 i also removed the blank lines . instead of sending u for another round.

@suhailopensource
suhailopensource merged commit 0cd81bf into suhailopensource:main Sep 4, 2026
7 checks passed
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.

[bug] : smoke tests don't cover parseId

2 participants