Skip to content

Commit

Permalink
Use temporary test-only build of mocha.js for browsers tests. Avoids …
Browse files Browse the repository at this point in the history
…accidental check-ins of dist file in contributions
  • Loading branch information
Munter committed Jan 18, 2017
1 parent 52a1957 commit 8a93a54
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions .eslintignore
@@ -1,3 +1,4 @@
coverage/
lib/to-iso-string/**/*.js
mocha.js
BUILDTMP
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -12,3 +12,4 @@ npm-debug.log*
*.orig
.nyc_output/
coverage/
BUILDTMP/
9 changes: 5 additions & 4 deletions Makefile
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
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 8a93a54

Please sign in to comment.