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.
		
			
				
	
	
		
			18 lines
		
	
	
	
		
			614 B
		
	
	
	
		
			Text
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
	
		
			614 B
		
	
	
	
		
			Text
		
	
	
		
			Executable file
		
	
	
	
	
THIS_SCRIPT=$(dirname "$0");
 | 
						|
WASM_PROJECT=$THIS_SCRIPT/../../automerge-wasm;
 | 
						|
JS_PROJECT=$THIS_SCRIPT/../../automerge-js;
 | 
						|
 | 
						|
yarn --cwd $WASM_PROJECT install;
 | 
						|
# 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;
 | 
						|
 | 
						|
 | 
						|
 |