Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use temporary test-only build of mocha.js for browsers tests #2669

Merged
merged 1 commit into from
Jan 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worth noting that this makes the directory quite obvious (not only is it not a dot-directory like .buildtmp, but it's in CAPs); I assume this is intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a successful test run the directory is cleaned out. This happens in the npm test script. Changing the directory name is a minor thing. I'm open to suggestions of something better

@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