Switch to use Browserify for builds

Fixes #362.
This commit is contained in:
Colin Snover 2015-05-27 13:04:16 +00:00
parent e4286f81f4
commit afc8aa1d50
6 changed files with 767 additions and 1029 deletions

View file

@ -8,10 +8,9 @@ REPORTER = dot
all: chai.js
chai.js: node_modules lib/* components
chai.js: node_modules lib/*
@printf "==> [Browser :: build]\n"
@./node_modules/.bin/component-build -s chai -o .
@mv build.js chai.js
@./node_modules/.bin/browserify --bare --outfile chai.js --standalone chai --entry index.js
#
# Node Module
@ -20,18 +19,6 @@ chai.js: node_modules lib/* components
node_modules: package.json
@npm install
#
# Components
#
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
#
@ -50,17 +37,17 @@ test-cov: node_modules
--require ./test/bootstrap \
$(TESTS) \
test-phantom: build
test-phantom: chai.js
@printf "==> [Test :: Karma (PhantomJS)]\n"
@./node_modules/karma/bin/karma start \
--single-run --browsers PhantomJS
test-firefox: build
test-firefox: chai.js
@printf "==> [Test :: Karma (Firefox)]\n"
@./node_modules/karma/bin/karma start \
--browsers Firefox
test-sauce: build
test-sauce: chai.js
@printf "==> [Test :: Karma (Sauce)]\n"
@CHAI_TEST_ENV=sauce ./node_modules/karma/bin/karma start \
--single-run
@ -74,7 +61,7 @@ test-travisci:
# Clean up
#
clean: clean-node clean-browser clean-components clean-cov
clean: clean-node clean-browser clean-cov
clean-node:
@rm -rf node_modules
@ -82,10 +69,6 @@ clean-node:
clean-browser:
@rm -f chai.js
clean-components:
@rm -rf build
@rm -rf components
clean-cov:
@rm -rf coverage
@ -95,4 +78,4 @@ clean-cov:
.PHONY: all
.PHONY: test test-all test-node test-phantom test-sauce test-cov
.PHONY: clean clean-node clean-browser clean-components clean-cov
.PHONY: clean clean-node clean-browser clean-cov

1704
chai.js

File diff suppressed because it is too large Load diff

View file

@ -1,51 +0,0 @@
{
"name": "chai"
, "repo": "chaijs/chai"
, "version": "2.3.0"
, "description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic."
, "license": "MIT"
, "keywords": [
"test"
, "assertion"
, "assert"
, "testing"
, "chai"
]
, "main": "index.js"
, "scripts": [
"index.js"
, "lib/chai.js"
, "lib/chai/assertion.js"
, "lib/chai/config.js"
, "lib/chai/core/assertions.js"
, "lib/chai/interface/assert.js"
, "lib/chai/interface/expect.js"
, "lib/chai/interface/should.js"
, "lib/chai/utils/addChainableMethod.js"
, "lib/chai/utils/addMethod.js"
, "lib/chai/utils/addProperty.js"
, "lib/chai/utils/flag.js"
, "lib/chai/utils/getActual.js"
, "lib/chai/utils/getEnumerableProperties.js"
, "lib/chai/utils/getMessage.js"
, "lib/chai/utils/getName.js"
, "lib/chai/utils/getPathValue.js"
, "lib/chai/utils/getPathInfo.js"
, "lib/chai/utils/hasProperty.js"
, "lib/chai/utils/getProperties.js"
, "lib/chai/utils/index.js"
, "lib/chai/utils/inspect.js"
, "lib/chai/utils/objDisplay.js"
, "lib/chai/utils/overwriteMethod.js"
, "lib/chai/utils/overwriteProperty.js"
, "lib/chai/utils/overwriteChainableMethod.js"
, "lib/chai/utils/test.js"
, "lib/chai/utils/transferFlags.js"
, "lib/chai/utils/type.js"
]
, "dependencies": {
"chaijs/assertion-error": "1.0.0"
, "chaijs/deep-eql": "0.1.3"
}
, "development": {}
}

View file

@ -2,7 +2,7 @@ module.exports = function(config) {
config.set({
frameworks: [ 'mocha' ]
, files: [
'build/build.js'
'chai.js'
, 'test/bootstrap/karma.js'
, 'test/*.js'
]

View file

@ -37,7 +37,7 @@
"deep-eql": "0.1.3"
},
"devDependencies": {
"component": "*",
"browserify": "10.2.1",
"karma": "0.12.x",
"karma-mocha": "*",
"karma-sauce-launcher": "0.2.x",

View file

@ -1,9 +1,3 @@
/*!
* Attach chai to global
*/
window.chai = require('chai');
/*!
* Provide check for fail function.
*/