From 8a93a542f177c7cc66c2d45bc0f8cdcaf5f03ba5 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 | 5 +++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.eslintignore b/.eslintignore index d5134e407e..1ce4437ab5 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ coverage/ lib/to-iso-string/**/*.js mocha.js +BUILDTMP diff --git a/.gitignore b/.gitignore index 05cc01726e..9b94c5bee0 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ npm-debug.log* *.orig .nyc_output/ coverage/ +BUILDTMP/ diff --git a/Makefile b/Makefile index c7d9e8a342..7abbaad0d7 100644 --- a/Makefile +++ b/Makefile @@ -18,8 +18,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' \ @@ -29,7 +30,7 @@ mocha.js: $(SRC) browser-entry.js clean: @printf "==> [Clean]\n" - rm -f mocha.js + rm -rf BUILDTMP lint: @printf "==> [Test :: Lint]\n" @@ -37,13 +38,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 d9fd1be3c8..0ca52f8b7c 100644 --- a/package.json +++ b/package.json @@ -299,10 +299,11 @@ "npm": ">= 1.4.x" }, "scripts": { - "test": "make test", + "test": "make test && make clean", "precoverage": "rm -rf coverage", "coverage": "COVERAGE=true npm run test", - "postcoverage": "istanbul-combine -d coverage -r lcov -r html coverage/reports/*/*.json" + "postcoverage": "istanbul-combine -d coverage -r lcov -r html coverage/reports/*/*.json", + "preversion": "make test && make mocha.js && git add mocha.js" }, "dependencies": { "browser-stdout": "1.3.0",