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 16, 2017
1 parent 8a3cab0 commit ab170ee
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
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 @@ -11,3 +11,4 @@ npm-debug.log*
.karma/
*.orig
.nyc_output/
BUILDTMP/
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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' \
Expand All @@ -20,21 +21,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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit ab170ee

Please sign in to comment.