test(js): add smoke tests for web bindings#1544
Open
caarloshenriq wants to merge 1 commit intopayjoin:masterfrom
Open
test(js): add smoke tests for web bindings#1544caarloshenriq wants to merge 1 commit intopayjoin:masterfrom
caarloshenriq wants to merge 1 commit intopayjoin:masterfrom
Conversation
Collaborator
Coverage Report for CI Build 25571281257Coverage remained the same at 85.169%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
xstoicunicornx
requested changes
May 9, 2026
Collaborator
xstoicunicornx
left a comment
There was a problem hiding this comment.
This is great! Since it is possible to load the web wasm in this way could we instead load the web wasm in the existing test files and run the tests for each side by side? Maybe worth using Jest so we can run tests for each payjoin instance without duplicating code? This will make it a lot easier to keep our tests in sync. For example the sender async persistence test seems to be missing from your unit test.
Additionally we probably want integration tests to be in scope as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1526
This PR adds smoke tests for the JavaScript web bindings (ESModule/WASM target), which were missing after the web bindings were introduced in #1513.
What was done
test/unit.web.test.tswith smoke tests for the web bindings, covering:package.jsonto include the new test file in thetestscriptApproach
The web bindings use WASM and are designed for browser/bundler environments (Vite). To test them in Node.js without introducing new dependencies, the tests load the
.wasmbinary directly viareadFileSyncand pass it to theinitAsyncfunction, bypassing the Vite-specific asset import. This allows the existingnode:test+tsxinfrastructure to be reused.Notes
I used Claude Sonnet 4.6 to help me understand the codebase.
Pull Request Checklist
Please confirm the following before requesting review:
AI
in the body of this PR.