Skip to content

Commit

Permalink
removed test.js file in favor of handling its function directly in th…
Browse files Browse the repository at this point in the history
…e 'npm test' script. added node version requirements for wasm network request functionality to readme and package.json
  • Loading branch information
alexpitsikoulis committed Sep 26, 2024
1 parent 667813e commit 81597a1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 25 deletions.
3 changes: 2 additions & 1 deletion wasm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ More information on these concepts can be found at the [Aleo Developer Hub](http

The [rollup-plugin-rust](https://github.com/wasm-tool/rollup-plugin-rust/) tool is used to compile the Rust code in this crate into JavaScript
modules which can be imported into other JavaScript projects.
Node version must be `18.0.0` or higher in order for WASM modules to make network requests.

#### Installation

Expand All @@ -46,7 +47,7 @@ This will produce `.js` and `.wasm` files inside of the `dist` folder.

Run tests in Node.js
```bash
wasm-pack test --node
npm test
```

Run tests in a browser
Expand Down
18 changes: 11 additions & 7 deletions wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
"The Provable Team"
],
"license": "GPL-3.0",
"type": "module",
"main": "./dist/testnet/index.js",
"browser": "./dist/testnet/index.js",
"types": "./dist/testnet/index.d.ts",
"main": "./dist/index.js",
"browser": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": "./dist/testnet/index.js",
"./worker.js": "./dist/testnet/worker.js",
Expand Down Expand Up @@ -38,13 +37,18 @@
},
"homepage": "https://github.com/ProvableHQ/sdk#readme",
"scripts": {
"build": "rimraf dist && node build.js",
"test": "node test.js"
"build": "rimraf dist && rollup -c rollup.config.js && cpr js/types dist && rimraf dist/wasm*",
"prepublish": "yarn build",
"test": "trap \"npm pkg set type='module'\" && echo EXIT && npm pkg delete type \n declare -a networks=('testnet', 'mainnet') \n for n in \"${networks[@]}\" \n do \n wasm-pack test --node --features $n \n done"
},
"devDependencies": {
"@rollup/plugin-virtual": "^3.0.2",
"@wasm-tool/rollup-plugin-rust": "^2.4.2",
"rimraf": "^5.0.1",
"rollup": "^3.27.2"
}
},
"engines": {
"node": ">=18.0.0"
},
"type": "module"
}
17 changes: 0 additions & 17 deletions wasm/test.js

This file was deleted.

0 comments on commit 81597a1

Please sign in to comment.