Skip to content

Commit

Permalink
mocha: store the compiled js files in a separate..
Browse files Browse the repository at this point in the history
folder away from the typescript files.

Signed-off-by: Dennis Francis <[email protected]>
Change-Id: Ibc1ecd263f53b2e6db736d9c6f1330998d4e2bf8
  • Loading branch information
dennisfrancis committed Jan 24, 2025
1 parent 7a50f22 commit 540f67f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion browser/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ bower.json
component.json

mocha.log
mocha_tests/*.js
mocha_tests/js/**/*.js
tscompile.done
duplication.log

Expand Down
5 changes: 3 additions & 2 deletions browser/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ QUIET_ECHO_ = $(QUIET_ECHO_$(AM_DEFAULT_VERBOSITY))
QUIET_ECHO_0 = @echo " ECHO " $@;

MOCHA_DIR = $(srcdir)/mocha_tests
MOCHA_JS_DIR = $(MOCHA_DIR)/js
MOCHA_TS_FILES = $(wildcard $(MOCHA_DIR)/*.ts)
MOCHA_TS_JS_FILES := $(MOCHA_TS_FILES:.ts=.js)
MOCHA_TS_JS_FILES = $(patsubst $(MOCHA_DIR)/%.ts,$(MOCHA_JS_DIR)/%.js,$(MOCHA_TS_FILES))
# tsc can report a failure, but still create a .js and a second make attempt will succeed,
# so if this returns an error then delete the target
$(MOCHA_TS_JS_FILES): %.js: %.ts
$(MOCHA_JS_DIR)/%.js: $(MOCHA_DIR)/%.ts
$(QUIET_TSC) $(builddir)/node_modules/typescript/bin/tsc $< --outfile $@ --module none --lib dom,es2016 --target ES5 || (rm -f $@ && false)

JQUERY_LIGHTNESS_IMAGE_PATH = $(srcdir)/images/jquery-ui-lightness
Expand Down
Empty file added browser/mocha_tests/js/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"nan": "^2.22.0"
},
"scripts": {
"test": "mocha 'mocha_tests/**/*.js'",
"test": "mocha 'mocha_tests/js/**/*.js'",
"test-single": "mocha",
"duplication": "jscpd --ignore src/layer/tile/CanvasTileWorker.js ./src/ --exitCode 1 --min-lines 17"
}
Expand Down

0 comments on commit 540f67f

Please sign in to comment.