2023-09-04 21:13:58 -05:00
|
|
|
#!/bin/bash
|
|
|
|
set -eo pipefail
|
|
|
|
|
2023-09-06 21:13:05 -05:00
|
|
|
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
|
2023-09-29 03:33:04 -05:00
|
|
|
original_tmpdir=$TMPDIR
|
2023-11-05 17:38:05 -06:00
|
|
|
mkdir -p ~/tmp
|
2023-09-29 03:33:04 -05:00
|
|
|
export TMPDIR=~/tmp
|
2023-09-06 21:13:05 -05:00
|
|
|
npm run test:headless
|
2023-09-29 03:33:04 -05:00
|
|
|
export TMPDIR=$original_tmpdir
|
2023-09-06 21:13:05 -05:00
|
|
|
|
|
|
|
popd &> /dev/null
|