2011-12-07 06:10:15 +00:00
|
|
|
|
2011-12-15 10:28:16 +00:00
|
|
|
TESTS = test/*.js
|
2013-02-03 23:01:06 +00:00
|
|
|
REPORTER = dot
|
2011-12-07 06:10:15 +00:00
|
|
|
|
2013-02-03 23:01:06 +00:00
|
|
|
#
|
|
|
|
# Browser Build
|
|
|
|
#
|
2011-12-07 06:10:15 +00:00
|
|
|
|
2013-09-18 02:13:12 +00:00
|
|
|
all: chai.js
|
|
|
|
|
2013-04-29 22:15:16 +00:00
|
|
|
chai.js: node_modules lib/* components
|
2013-09-17 21:22:36 +00:00
|
|
|
@printf "==> [Browser :: build]\n"
|
2013-04-29 21:42:25 +00:00
|
|
|
@./node_modules/.bin/component-build -s chai -o .
|
|
|
|
@mv build.js chai.js
|
2011-12-07 06:10:15 +00:00
|
|
|
|
2013-09-18 02:13:12 +00:00
|
|
|
#
|
|
|
|
# Node Module
|
|
|
|
#
|
|
|
|
|
|
|
|
node_modules: package.json
|
|
|
|
@npm install
|
|
|
|
|
2013-02-03 23:01:06 +00:00
|
|
|
#
|
|
|
|
# Components
|
|
|
|
#
|
|
|
|
|
|
|
|
build: components lib/*
|
2013-09-17 21:22:36 +00:00
|
|
|
@printf "==> [Component :: build]\n"
|
2013-02-03 23:01:06 +00:00
|
|
|
@./node_modules/.bin/component-build --dev
|
|
|
|
|
|
|
|
components: node_modules component.json
|
2013-09-17 21:22:36 +00:00
|
|
|
@printf "==> [Component :: install]\n"
|
2013-02-03 23:01:06 +00:00
|
|
|
@./node_modules/.bin/component-install --dev
|
|
|
|
|
2013-02-03 19:41:13 +00:00
|
|
|
#
|
|
|
|
# Tests
|
|
|
|
#
|
|
|
|
|
2013-09-18 02:13:12 +00:00
|
|
|
test: test-node test-phantom
|
2011-12-15 10:28:16 +00:00
|
|
|
|
2013-02-03 23:01:06 +00:00
|
|
|
test-node: node_modules
|
2013-09-17 21:22:36 +00:00
|
|
|
@printf "==> [Test :: Node.js]\n"
|
2011-12-15 10:28:16 +00:00
|
|
|
@NODE_ENV=test ./node_modules/.bin/mocha \
|
2012-11-29 08:18:25 +00:00
|
|
|
--require ./test/bootstrap \
|
2011-12-15 10:28:16 +00:00
|
|
|
--reporter $(REPORTER) \
|
|
|
|
$(TESTS)
|
|
|
|
|
2013-02-03 23:01:06 +00:00
|
|
|
test-cov: lib-cov
|
2013-02-03 19:41:13 +00:00
|
|
|
@CHAI_COV=1 NODE_ENV=test ./node_modules/.bin/mocha \
|
|
|
|
--require ./test/bootstrap \
|
|
|
|
--reporter html-cov \
|
|
|
|
$(TESTS) \
|
|
|
|
> coverage.html
|
|
|
|
|
2013-09-18 02:13:12 +00:00
|
|
|
test-phantom: build
|
|
|
|
@printf "==> [Test :: Karma (PhantomJS)]\n"
|
2013-11-27 16:15:29 +00:00
|
|
|
@./node_modules/karma/bin/karma start \
|
2013-09-18 03:12:16 +00:00
|
|
|
--single-run --browsers PhantomJS
|
2013-09-18 02:13:12 +00:00
|
|
|
|
|
|
|
test-sauce: build
|
|
|
|
@printf "==> [Test :: Karma (Sauce)]\n"
|
2013-11-27 16:15:29 +00:00
|
|
|
@CHAI_TEST_ENV=sauce ./node_modules/karma/bin/karma start \
|
2013-09-18 02:13:12 +00:00
|
|
|
--single-run
|
|
|
|
|
|
|
|
test-coveralls: lib-cov
|
2013-06-27 17:40:19 +00:00
|
|
|
@CHAI_COV=1 NODE_ENV=test ./node_modules/.bin/mocha \
|
|
|
|
--require ./test/bootstrap \
|
|
|
|
--reporter mocha-lcov-reporter \
|
|
|
|
$(TESTS) \
|
|
|
|
| ./node_modules/coveralls/bin/coveralls.js
|
|
|
|
|
2013-09-18 02:13:12 +00:00
|
|
|
test-travisci: lib-cov
|
|
|
|
@echo TRAVIS_JOB_ID $(TRAVIS_JOB_ID)
|
|
|
|
@make test-node
|
|
|
|
@make test-coveralls
|
|
|
|
@make test-sauce
|
|
|
|
|
2013-02-03 19:41:13 +00:00
|
|
|
#
|
|
|
|
# Coverage
|
|
|
|
#
|
2012-02-24 07:59:52 +00:00
|
|
|
|
2013-09-17 21:22:36 +00:00
|
|
|
lib-cov:
|
|
|
|
@rm -rf lib-cov
|
2013-06-27 17:40:19 +00:00
|
|
|
@./node_modules/jscoverage/bin/jscoverage lib lib-cov
|
2012-02-24 07:59:52 +00:00
|
|
|
|
2013-02-03 19:41:13 +00:00
|
|
|
#
|
|
|
|
# Clean up
|
|
|
|
#
|
|
|
|
|
2013-02-03 23:01:06 +00:00
|
|
|
clean: clean-node clean-browser clean-components clean-cov
|
|
|
|
|
|
|
|
clean-node:
|
|
|
|
@rm -rf node_modules
|
2013-02-03 19:41:13 +00:00
|
|
|
|
|
|
|
clean-browser:
|
|
|
|
@rm -f chai.js
|
|
|
|
|
|
|
|
clean-components:
|
|
|
|
@rm -rf build
|
|
|
|
@rm -rf components
|
|
|
|
|
2012-07-01 02:54:38 +00:00
|
|
|
clean-cov:
|
2013-02-03 19:41:13 +00:00
|
|
|
@rm -rf lib-cov
|
2012-07-01 02:54:38 +00:00
|
|
|
@rm -f coverage.html
|
|
|
|
|
2013-02-03 23:01:06 +00:00
|
|
|
#
|
|
|
|
# Instructions
|
|
|
|
#
|
|
|
|
|
2013-04-29 22:15:16 +00:00
|
|
|
.PHONY: all
|
2013-09-18 02:13:12 +00:00
|
|
|
.PHONY: test test-all test-node test-phantom test-sauce test-cov test-coveralls
|
2013-04-29 22:15:16 +00:00
|
|
|
.PHONY: clean clean-node clean-browser clean-components clean-cov
|