diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2021-09-24 17:54:42 +0530 |
---|---|---|
committer | Dennis Francis <dennisfrancis.in@gmail.com> | 2021-10-06 14:00:22 +0530 |
commit | f42bc037f52475ded2d8d21a38bb3d976b99b5c2 (patch) | |
tree | 06c431e57d37e0e1461488cdd6f43d12343e7442 | |
parent | migrate L.SheetGeometry and dependencies to typescript (diff) | |
download | online-f42bc037f52475ded2d8d21a38bb3d976b99b5c2.tar.gz online-f42bc037f52475ded2d8d21a38bb3d976b99b5c2.zip |
mocha: easier running of a specific test
While adding new mocha tests, it is helpful to run and debug just those
tests.
For instance to run the unit test file for SheetGeomtry, now this is possible by running:
$ make build-tests && npm run test-single -- mocha_tests/SheetGeometry.test.js
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I730f79409c05b5ea67fa42c5d0b58cc2f92e238a
-rw-r--r-- | loleaflet/Makefile.am | 3 | ||||
-rw-r--r-- | loleaflet/package.json | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am index b089358014..e85e7cea21 100644 --- a/loleaflet/Makefile.am +++ b/loleaflet/Makefile.am @@ -741,6 +741,9 @@ $(abs_srcdir)/admin/jsconfig.json: jsconfig: $(abs_srcdir)/jsconfig.json $(abs_srcdir)/admin/jsconfig.json +build-tests: $(MOCHA_TS_JS_FILES) + @echo "Build of mocha test finished." + check-local: $(MOCHA_TS_JS_FILES) @echo "Running mocha tests..." @$(NODE) node_modules/mocha/bin/mocha "$(srcdir)/mocha_tests/**/*.js" diff --git a/loleaflet/package.json b/loleaflet/package.json index ce73234a90..d5038297ed 100644 --- a/loleaflet/package.json +++ b/loleaflet/package.json @@ -48,6 +48,7 @@ "jsdom": "^16.4.0" }, "scripts": { - "test": "mocha 'mocha_tests/**/*.js'" + "test": "mocha 'mocha_tests/**/*.js'", + "test-single": "mocha" } } |