☕️ Classic, reliable, trusted test framework for Node.js and the browser
Use temporary test-only build of mocha.js for browsers tests. Avoids accidental check-ins of dist file in contributions
Peter Müller8a93a542f177
diff --git a/.eslintignore b/.eslintignoreindex d5134e40..1ce4437a 100644--- a/.eslintignore+++ b/.eslintignore@@ -1,3 +1,4 @@coverage/lib/to-iso-string/**/*.jsmocha.js+BUILDTMPdiff --git a/.gitignore b/.gitignoreindex 05cc0172..9b94c5be 100644--- a/.gitignore+++ b/.gitignore@@ -12,3 +12,4 @@ npm-debug.log**.orig.nyc_output/coverage/+BUILDTMP/diff --git a/Makefile b/Makefileindex c7d9e8a3..7abbaad0 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.jsclean:@printf "==> [Clean]\n"- rm -f mocha.js+ rm -rf BUILDTMPlint:@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-exportstest: lint test-node test-browsertest-browser-unit:@printf "==> [Test :: Browser]\n"- NODE_PATH=. $(KARMA) start --single-run+ NODE_PATH=BUILDTMP $(KARMA) start --single-runtest-browser-bdd:@printf "==> [Test :: Browser :: BDD]\n"diff --git a/package.json b/package.jsonindex d9fd1be3..0ca52f8b 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",