mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Set up javascript tests
This commit is contained in:
26
web/Makefile
Normal file
26
web/Makefile
Normal file
@@ -0,0 +1,26 @@
|
||||
test_bundle := build/bundles/test.js
|
||||
node_modules := node_modules/.bin/mocha
|
||||
|
||||
$(node_modules):
|
||||
npm install
|
||||
|
||||
core:
|
||||
cd ../core; ./gradlew --quiet jsMainClasses jsTestClasses
|
||||
cp ../core/build/classes/kotlin/js/*/*.js node_modules/
|
||||
|
||||
$(test_bundle): test/index.js core
|
||||
mkdir -p build/bundles
|
||||
npx webpack $< --silent --mode production --output $@
|
||||
|
||||
test: $(test_bundle) $(node_modules)
|
||||
mkdir -p build/reports
|
||||
npx mocha $@ --reporter xunit > build/reports/tests.xml
|
||||
npx mocha $@
|
||||
|
||||
clean:
|
||||
rm -rf build
|
||||
|
||||
distclean: clean
|
||||
rm -rf node_modules
|
||||
|
||||
.PHONY: test clean distclean core
|
||||
Reference in New Issue
Block a user