<commit_before>
TESTS = test/*.js
REPORTER = dot

all: chai.js

chai.js: $(SRC)
	@node support/compile $^

clean:
	@rm -f chai.js

test:
	@NODE_ENV=test ./node_modules/.bin/mocha \
		--require ./test/bootstrap \
		--reporter $(REPORTER) \
		--ui tdd \
		$(TESTS)

test-cov: lib-cov
	@CHAI_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html

lib-cov: clean-cov
	@jscoverage lib lib-cov

clean-cov:
	@rm -f coverage.html
	@rm -fr lib-cov

.PHONY: all chai.js clean clean-cov test docs clean-docs doc-server test-cov lib-cov<commit_msg>makefile: refactor for fine grain control of testing scenarios<commit_after>
TESTS = test/*.js
REPORTER = spec

all: chai.js

chai.js: 
	@node support/compile

#
# Tests
# 

test: test-node

test-node:
	@printf "\n  ==> [Node.js]"
	@NODE_ENV=test ./node_modules/.bin/mocha \
		--require ./test/bootstrap \
		--reporter $(REPORTER) \
		--ui tdd \
		$(TESTS)

test-browser: chai.js has-phantomjs
	@printf "\n  ==> [Browser Build via PhantomJS]"
	@./node_modules/.bin/mocha-phantomjs \
		--R ${REPORTER} \
		./test/browser/index.html

test-component: build has-phantomjs
	@printf "\n  ==> [Component Build via PhantomJS]"
	@./node_modules/.bin/mocha-phantomjs \
		--R ${REPORTER} \
		./test/browser/component.html

test-cov: lib-cov
	@CHAI_COV=1 NODE_ENV=test ./node_modules/.bin/mocha \
		--require ./test/bootstrap \
		--reporter html-cov \
		--ui tdd \
		$(TESTS) \
		> coverage.html

#
# Components
# 

build: components lib/*
	@./node_modules/.bin/component-build --dev

components: component.json
	@./node_modules/.bin/component-install --dev

#
# Coverage
# 

lib-cov: clean-cov
	@jscoverage lib lib-cov

#
# Clean up
# 

clean: clean-browser clean-components clean-cov

clean-browser:
	@rm -f chai.js

clean-components:
	@rm -rf build
	@rm -rf components

clean-cov:
	@rm -rf lib-cov
	@rm -f coverage.html

#
# Utils
#

has-phantomjs:
ifeq ($(shell which phantomjs),)
	$(error PhantomJS is not installed. Download from http://phantomjs.org or Homebrew)
endif

.PHONY: all clean clean-browser clean-components clean-cov test test-cov test-node 
{'fraction_non_alphanumeric': 0.1541046567450792, 'fraction_numerical': 0.0009601536245799327, 'mean_word_length': 3.1023622047244093, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3236598', 'n_tokens_mistral': 854, 'n_tokens_neox': 811, 'n_words': 193}