Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Commit

Permalink
Merge pull request mochajs#2669 from mochajs/avoid-dist-file-modifica…
Browse files Browse the repository at this point in the history
…tion-in-test

Use temporary test-only build of mocha.js for browsers tests
  • Loading branch information
Munter authored Jan 19, 2017
2 parents fc105d5 + 46fedcd commit b62fbfb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
coverage/
lib/to-iso-string/**/*.js
mocha.js
BUILDTMP
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ npm-debug.log*
*.orig
.nyc_output/
coverage/
BUILDTMP/
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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' \
Expand All @@ -29,21 +30,21 @@ mocha.js: $(SRC) browser-entry.js

clean:
@printf "==> [Clean]\n"
rm -f mocha.js
rm -rf BUILDTMP

lint:
@printf "==> [Test :: Lint]\n"
$(ESLINT) . bin/*

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"
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b62fbfb

Please sign in to comment.