From ab170eee126fbda19af3c161f27995d7e44c5901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20M=C3=BCller?= Date: Mon, 16 Jan 2017 23:40:24 +0100 Subject: [PATCH] Use temporary test-only build of mocha.js for browsers tests. Avoids accidental check-ins of dist file in contributions --- .eslintignore | 1 + .gitignore | 1 + Makefile | 9 +++++---- package.json | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.eslintignore b/.eslintignore index 3e4b026a81..f71b52b33f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,3 @@ lib/to-iso-string/**/*.js mocha.js +BUILDTMP diff --git a/.gitignore b/.gitignore index 05fd3db57e..5291ce4cba 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ npm-debug.log* .karma/ *.orig .nyc_output/ +BUILDTMP/ diff --git a/Makefile b/Makefile index 40a098e318..dd1555b3b1 100644 --- a/Makefile +++ b/Makefile @@ -9,8 +9,9 @@ TESTS = $(shell find test -name "*.js" -type f | sort) all: mocha.js -mocha.js: $(SRC) browser-entry.js +mocha.js BUILDTMP/mocha.js: $(SRC) browser-entry.js @printf "==> [Browser :: build]\n" + mkdir -p ${@D} $(BROWSERIFY) ./browser-entry \ --plugin ./scripts/dedefine \ --ignore 'fs' \ @@ -20,7 +21,7 @@ mocha.js: $(SRC) browser-entry.js clean: @printf "==> [Clean]\n" - rm -f mocha.js + rm -rf BUILDTMP lint: @printf "==> [Test :: Lint]\n" @@ -28,13 +29,13 @@ lint: test-node: test-bdd test-tdd test-qunit test-exports test-unit test-integration test-jsapi test-compilers test-glob test-requires test-reporters test-only test-global-only -test-browser: clean mocha.js test-browser-unit test-browser-bdd test-browser-qunit test-browser-tdd test-browser-exports +test-browser: clean BUILDTMP/mocha.js test-browser-unit test-browser-bdd test-browser-qunit test-browser-tdd test-browser-exports test: lint test-node test-browser test-browser-unit: @printf "==> [Test :: Browser]\n" - NODE_PATH=. $(KARMA) start --single-run + NODE_PATH=BUILDTMP $(KARMA) start --single-run test-browser-bdd: @printf "==> [Test :: Browser :: BDD]\n" diff --git a/package.json b/package.json index 764c159381..069e8f3637 100644 --- a/package.json +++ b/package.json @@ -299,7 +299,8 @@ "npm": ">= 1.4.x" }, "scripts": { - "test": "make test" + "test": "make test && make clean", + "preversion": "make test && make mocha.js && git add mocha.js" }, "dependencies": { "browser-stdout": "1.3.0",