chai/Makefile
ossdev07 929c109e1a chore: Removed phantomjs dependency (#1204)
* chore: Removed phantomjs dependency

Added support for chrome headless

Signed-off-by: ossdev07 <ossdev@puresoftware.com>

* Update karma.conf.js

* Update Makefile
2018-11-09 19:28:45 +01:00

106 lines
1.9 KiB
Makefile

TESTS = test/*.js
REPORTER = dot
#
# Browser Build
#
all: chai.js
chai.js: node_modules lib/*
@printf "==> [Browser :: build]\n"
@./node_modules/.bin/browserify \
--bare \
--outfile chai.js \
--standalone chai \
--entry index.js
#
# Release Task
#
define release
./node_modules/.bin/bump -y --$(1) package.json lib/chai.js
make chai.js
git add --force chai.js lib/chai.js package.json bower.json
npm ls --depth=-1 --long . --loglevel silent | head -1 | git commit -F-
endef
release-patch:
@$(call release,patch)
release-minor:
@$(call release,minor)
release-major:
@$(call release,major)
#
# Node Module
#
node_modules: package.json
@npm install
#
# Tests
#
test: test-node test-chrome
test-node: node_modules
@printf "==> [Test :: Node.js]\n"
@NODE_ENV=test ./node_modules/.bin/mocha \
--require ./test/bootstrap \
--reporter $(REPORTER) \
$(TESTS)
test-cov: node_modules
@NODE_ENV=test ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- \
--require ./test/bootstrap \
$(TESTS) \
test-chrome: clean-browser chai.js
@printf "==> [Test :: Karma (chrome)]\n"
@./node_modules/karma/bin/karma start \
--single-run --browsers HeadlessChrome
test-firefox: clean-browser chai.js
@printf "==> [Test :: Karma (Firefox)]\n"
@./node_modules/karma/bin/karma start \
--browsers Firefox
test-sauce: clean-browser chai.js
@printf "==> [Test :: Karma (Sauce)]\n"
@CHAI_TEST_ENV=sauce ./node_modules/karma/bin/karma start \
--single-run
test-travisci:
@echo TRAVIS_JOB_ID $(TRAVIS_JOB_ID)
@make test-cov
@make test-sauce
#
# Clean up
#
clean: clean-node clean-browser clean-cov
clean-node:
@rm -rf node_modules
clean-browser:
@rm -f chai.js
clean-cov:
@rm -rf coverage
#
# Instructions
#
.PHONY: all
.PHONY: test test-all test-node test-chrome test-sauce test-cov
.PHONY: clean clean-node clean-browser clean-cov
.PHONY: release-patch release-minor release-major