(wasm) webdriver-based tests for JS/TS apis, update README

This commit is contained in:
Brandon Vandegrift
2023-09-06 22:13:05 -04:00
parent fa13f95a10
commit 40a1c9933c
17 changed files with 10328 additions and 222 deletions
+17 -1
View File
@@ -1,4 +1,20 @@
#!/bin/bash
set -eo pipefail
WASM_BINDGEN_USE_NO_MODULE=true wasm-pack test --firefox "$@"
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
pushd "$SCRIPTDIR" &> /dev/null
WASM_PACK_FLAGS="--dev"
if [[ "$1" == "release" ]]; then
WASM_PACK_FLAGS="--release"
fi
# Build wasm into an npm package, output into ./pkg
wasm-pack build $WASM_PACK_FLAGS --target bundler --weak-refs
# Install test deps and run test suite
cd tests
npm install
npm run test:headless
popd &> /dev/null