Skip to content

Commit

Permalink
Update Makefile.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Aug 1, 2013
1 parent d1408bf commit e558e56
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 30 deletions.
49 changes: 27 additions & 22 deletions Makefile
@@ -1,44 +1,49 @@
SOURCES = *.js
TESTS = test/*.test.js

# ==============================================================================
# Node Tests
# ==============================================================================
lint: lint-jshint
test: test-mocha
test-cov: test-istanbul-mocha
view-cov: view-istanbul-report

MOCHA = ./node_modules/.bin/mocha

test: test-node
test-node: node_modules
$(MOCHA) \
--reporter spec \
--require test/bootstrap/node $(TESTS)
# ==============================================================================
# Node.js
# ==============================================================================
include support/mk/node.mk
include support/mk/mocha.mk

node_modules:
npm install
# ==============================================================================
# Browserify
# ==============================================================================
BROWSERIFY_MAIN = ./index.js

include support/mk/browserify.mk
include support/mk/testling.mk

# ==============================================================================
# Code Quality
# ==============================================================================
include support/mk/notes.mk
include support/mk/jshint.mk
include support/mk/istanbul.mk

JSHINT = jshint

hint: lint
lint:
$(JSHINT) $(SOURCES)
# ==============================================================================
# Continuous Integration
# ==============================================================================
include support/mk/coveralls.mk

ci-travis: test test-cov
submit-coverage-to-coveralls: submit-istanbul-lcov-to-coveralls

# ==============================================================================
# Clean
# ==============================================================================

clean:
rm -rf build
rm -rf reports

clobber: clean
rm -rf node_modules
rm -rf components
rm -rf test/www/js/lib
clobber: clean clobber-node


.PHONY: test test-node hint lint clean clobber
.PHONY: lint test test-cov view-cov ci-travis clean clobber
10 changes: 10 additions & 0 deletions package.json
Expand Up @@ -35,5 +35,15 @@
},
"scripts": {
"test": "node_modules/.bin/mocha --reporter spec --require test/bootstrap/node test/*.test.js"
},
"testling": {
"browsers": [
"chrome/latest"
],
"harness" : "mocha",
"files": [
"test/bootstrap/testling.js",
"test/*.test.js"
]
}
}
3 changes: 3 additions & 0 deletions test/bootstrap/testling.js
@@ -0,0 +1,3 @@
var chai = require('chai');

window.expect = chai.expect;
8 changes: 0 additions & 8 deletions test/index.test.js
@@ -1,13 +1,5 @@
var merge = require('../index');

describe('utils-merge', function() {

it('should export function', function() {
expect(merge).to.be.a('function');
});

});

describe('merge', function() {

describe('an object', function() {
Expand Down
9 changes: 9 additions & 0 deletions test/module.test.js
@@ -0,0 +1,9 @@
var merge = require('../index');

describe('utils-merge', function() {

it('should export function', function() {
expect(merge).to.be.a('function');
});

});

0 comments on commit e558e56

Please sign in to comment.