Skip to content

Commit 56cbcf9

Browse files
OttoAllmendingerllm-git
andcommitted
feat(wasm-utxo): add wasm-bindgen-test for browser testing
Add testing dependencies for writing browser-based WASM tests Issue: BTC-2652 Co-authored-by: llm-git <[email protected]>
1 parent 5b01d61 commit 56cbcf9

File tree

4 files changed

+112
-0
lines changed

4 files changed

+112
-0
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,13 @@ jobs:
8080
- name: Check Source Code Formatting
8181
run: npm run check-fmt
8282

83+
- name: Wasm-Pack Test (Node)
84+
run: npm run test:wasm-pack-node
85+
working-directory: packages/wasm-utxo
86+
87+
- name: Wasm-Pack Test (Chrome)
88+
run: npm run test:wasm-pack-chrome
89+
working-directory: packages/wasm-utxo
90+
8391
- name: Unit Test
8492
run: npm --workspaces test

packages/wasm-utxo/Cargo.lock

Lines changed: 101 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/wasm-utxo/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ base64 = "0.22.1"
2020
serde = { version = "1.0", features = ["derive"] }
2121
serde_json = "1.0"
2222
hex = "0.4"
23+
wasm-bindgen-test = "0.3"
2324

2425
[profile.release]
2526
# this is required to make webpack happy

packages/wasm-utxo/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
},
2828
"scripts": {
2929
"test": "mocha --recursive test",
30+
"test:wasm-pack-node": "wasm-pack test --node",
31+
"test:wasm-pack-chrome": "wasm-pack test --headless --chrome",
3032
"build:wasm": "make js/wasm/ && make dist/node/js/wasm/ && make dist/browser/js/wasm/",
3133
"build:ts-browser": "tsc --noEmit false --module es2020 --target es2020 --outDir dist/browser",
3234
"build:ts-node": "tsc --noEmit false --outDir dist/node",

0 commit comments

Comments
 (0)