chai/Makefile

94 lines
1.6 KiB
Makefile
Raw Normal View History

2011-12-07 06:10:15 +00:00
2011-12-15 10:28:16 +00:00
TESTS = test/*.js
REPORTER = dot
2011-12-07 06:10:15 +00:00
#
# Browser Build
2014-01-26 06:35:09 +00:00
#
2011-12-07 06:10:15 +00:00
2013-09-18 02:13:12 +00:00
all: chai.js
chai.js: node_modules lib/* components
@printf "==> [Browser :: build]\n"
@./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
#
# Components
2014-01-26 06:35:09 +00:00
#
build: components lib/*
@printf "==> [Component :: build]\n"
@./node_modules/.bin/component-build --dev
components: node_modules component.json
@printf "==> [Component :: install]\n"
@./node_modules/.bin/component-install --dev
#
# Tests
2014-01-26 06:35:09 +00:00
#
2013-09-18 02:13:12 +00:00
test: test-node test-phantom
2011-12-15 10:28:16 +00:00
test-node: node_modules
@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)
2014-01-26 06:43:49 +00:00
test-cov: node_modules
@NODE_ENV=test ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- \
--require ./test/bootstrap \
$(TESTS) \
2013-09-18 02:13:12 +00:00
test-phantom: build
@printf "==> [Test :: Karma (PhantomJS)]\n"
@./node_modules/karma/bin/karma start \
--single-run --browsers PhantomJS
2013-09-18 02:13:12 +00:00
test-sauce: build
@printf "==> [Test :: Karma (Sauce)]\n"
@CHAI_TEST_ENV=sauce ./node_modules/karma/bin/karma start \
2013-09-18 02:13:12 +00:00
--single-run
test-travisci:
2013-09-18 02:13:12 +00:00
@echo TRAVIS_JOB_ID $(TRAVIS_JOB_ID)
2014-01-26 06:43:49 +00:00
@make test-cov
2013-09-18 02:13:12 +00:00
@make test-sauce
#
# Clean up
2014-01-26 06:35:09 +00:00
#
clean: clean-node clean-browser clean-components clean-cov
clean-node:
@rm -rf node_modules
clean-browser:
@rm -f chai.js
clean-components:
@rm -rf build
@rm -rf components
2012-07-01 02:54:38 +00:00
clean-cov:
2014-01-26 06:43:49 +00:00
@rm -rf coverage
2012-07-01 02:54:38 +00:00
#
# Instructions
#
2014-01-26 06:35:09 +00:00
.PHONY: all
.PHONY: test test-all test-node test-phantom test-sauce test-cov
.PHONY: clean clean-node clean-browser clean-components clean-cov