automerge/scripts/ci/js_tests
Alex Good 74a8af6ca6
Run the js_test in CI
We add a script for running the js tests in `scripts/ci/js_tests`. This
script can also be run locally. We move the `automerge-js` package to
below the `automerge-wasm` crate as it is specifically testing the wasm
interface. We also add an action to the github actions workflow for CI
to run the js tests.
2021-12-24 23:11:17 +00:00

17 lines
595 B
Text
Executable file

THIS_SCRIPT=$(dirname "$0");
WASM_PROJECT=$THIS_SCRIPT/../../automerge-wasm;
JS_PROJECT=$THIS_SCRIPT/../../automerge-wasm/automerge-js;
# This will take care of running wasm-pack
yarn --cwd $WASM_PROJECT build;
# If the dependencies are already installed we delete automerge-wasm. This makes
# this script usable for iterative development.
if [ -d $JS_PROJECT/node_modules/automerge-wasm ]; then
rm -rf $JS_PROJECT/node_modules/automerge-wasm
fi
# --check-files forces yarn to check if the local dep has changed
yarn --cwd $JS_PROJECT install --check-files;
yarn --cwd $JS_PROJECT test;