diff --git a/.gitignore b/.gitignore index ba2a97b..26846b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules coverage +npm-debug.log \ No newline at end of file diff --git a/package.json b/package.json index 3a2cda5..8323107 100644 --- a/package.json +++ b/package.json @@ -9,15 +9,12 @@ "author": "Marcus Stade", "license": "MIT", "devDependencies": { + "coveralls": "~2.8.0", + "expect.js": "^0.3.1", "istanbul": "~0.2.4", "mocha": "~1.17.1", - "chai": "~1.9.0", - "coveralls": "~2.8.0", "mocha-lcov-reporter": "0.0.1", - "sinon": "~1.9.0", - "mocha-sinon": "~1.1.0", - "sinon-chai": "~2.5.0", - "expect.js": "^0.3.1" + "must": "git://github.com/mstade/js-must#throw-error-instance" }, "repository": { "type": "git", diff --git a/test/apply.js b/test/apply.js index 0ba6228..817587d 100644 --- a/test/apply.js +++ b/test/apply.js @@ -23,7 +23,7 @@ describe('apply', function() { describe('when given a function `fn`', function() { describe('and no arguments', function(done) { it('should call the function without arguments', function(done) { - var fn = function() { + var fn = function() { expect(arguments.length).to.equal(0) done() } @@ -32,14 +32,14 @@ describe('apply', function() { }) it('should proxy the functions return value', function() { - expect(apply(constantly(3))).to.equal(3) + expect(apply(constantly(3))).to.equal(3) }) describe('and `fn` is bound', function() { it('should not affect the binding', function(done) { - var owner = {} + var owner = {} - var fn = function() { + var fn = function() { expect(arguments.length).to.equal(0) expect(this).to.equal(owner) done() @@ -52,7 +52,7 @@ describe('apply', function() { describe('and when given arguments', function(done) { it('should call the function with arguments', function(done) { - var fn = function() { + var fn = function() { expect(slice(arguments)).to.eql([1, true, 'wibble']) done() } @@ -61,14 +61,14 @@ describe('apply', function() { }) it('should proxy the functions return value', function() { - expect(apply(constantly, [3])).to.be.a('function') + expect(apply(constantly, [3])).to.be.a(Function) }) describe('and `fn` is bound', function() { it('should not affect the binding', function(done) { - var owner = {} + var owner = {} - var fn = function() { + var fn = function() { expect(slice(arguments)).to.eql([1, true, 'wibble']) expect(this).to.equal(owner) done() @@ -82,7 +82,7 @@ describe('apply', function() { }) var constantly = require('../lib/constantly') - , expect = require('chai').expect + , expect = require('must') , slice = require('../lib/slice') , apply = require('../lib/apply') , each = require('../lib/each') diff --git a/test/assert.js b/test/assert.js index 0ebdab4..cd32cb1 100644 --- a/test/assert.js +++ b/test/assert.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect +var expect = require('must') , assert = require('../lib/assert') , each = require('../lib/each') , src = require('../lib/src') @@ -24,7 +24,7 @@ describe('assert', function() { }) describe('and also given an instance of Error', function() { - it('should throw that error', function() { + it('should throw that instance', function() { var err = new Error('sad face') expect($(assert, x, err)).to.throw(err) }) diff --git a/test/call.js b/test/call.js index d79f945..796f267 100644 --- a/test/call.js +++ b/test/call.js @@ -73,7 +73,7 @@ describe('call', function() { }) }) -var expect = require('chai').expect +var expect = require('must') , slice = require('../lib/slice') , each = require('../lib/each') , call = require('../lib/call') \ No newline at end of file diff --git a/test/compose.js b/test/compose.js index 82c2a0a..8d22592 100644 --- a/test/compose.js +++ b/test/compose.js @@ -1,5 +1,5 @@ var partial = require('../lib/partial') - , expect = require('chai').expect + , expect = require('must') , comp = require('../lib/compose') describe('compose', function() { diff --git a/test/constantly.js b/test/constantly.js index d1b391a..9887b99 100644 --- a/test/constantly.js +++ b/test/constantly.js @@ -1,5 +1,5 @@ var constantly = require('../lib/constantly') - , expect = require('chai').expect + , expect = require('must') , each = require('../lib/each') , src = require('../lib/src') diff --git a/test/count.js b/test/count.js index 444d881..5eb81fc 100644 --- a/test/count.js +++ b/test/count.js @@ -1,5 +1,5 @@ var partial = require('../lib/partial') - , expect = require('chai').expect + , expect = require('must') , count = require('../lib/count') , seq = require('../lib/seq') diff --git a/test/each.js b/test/each.js index 7276314..e739982 100644 --- a/test/each.js +++ b/test/each.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect +var expect = require('must') , each = require('../lib/each') , src = require('../lib/src') , seq = require('../lib/seq') diff --git a/test/eq.js b/test/eq.js index cd9d04e..2e47879 100644 --- a/test/eq.js +++ b/test/eq.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect +var expect = require('must') , each = require('../lib/each') , eq = require('../lib/eq') diff --git a/test/get.js b/test/get.js index ca9774e..585e4f8 100644 --- a/test/get.js +++ b/test/get.js @@ -1,5 +1,5 @@ const partial = require('../lib/partial') - , expect = require('chai').expect + , expect = require('must') , each = require('../lib/each') , get = require('../lib/get') diff --git a/test/gt.js b/test/gt.js index ca429e3..0b23c8f 100644 --- a/test/gt.js +++ b/test/gt.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect +var expect = require('must') , gt = require('../lib/gt') describe('gt', function() { diff --git a/test/identity.js b/test/identity.js index 034cea4..a76fcaa 100644 --- a/test/identity.js +++ b/test/identity.js @@ -1,5 +1,5 @@ var identity = require('../lib/identity') - , expect = require('chai').expect + , expect = require('must') , each = require('../lib/each') , type = require('../lib/type') , PI = Math.PI diff --git a/test/is.js b/test/is.js index 40e984c..8147df1 100644 --- a/test/is.js +++ b/test/is.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect +var expect = require('must') , range = require('../lib/range') , each = require('../lib/each') , seq = require('../lib/seq') diff --git a/test/isEmpty.js b/test/isEmpty.js index 5e9569b..e825238 100644 --- a/test/isEmpty.js +++ b/test/isEmpty.js @@ -1,5 +1,5 @@ var isEmpty = require('../lib/isEmpty') - , expect = require('chai').expect + , expect = require('must') , each = require('../lib/each') , seq = require('../lib/seq') , src = require('../lib/src') diff --git a/test/isnt.js b/test/isnt.js index 7f5547a..2f7ddbd 100644 --- a/test/isnt.js +++ b/test/isnt.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect +var expect = require('must') , isnt = require('../lib/isnt') , each = require('../lib/each') , src = require('../lib/src') diff --git a/test/lt.js b/test/lt.js index 3c50276..d6b3b4e 100644 --- a/test/lt.js +++ b/test/lt.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect +var expect = require('must') , lt = require('../lib/lt') describe('lt', function() { diff --git a/test/merge.js b/test/merge.js index 8013f2b..f5dc46d 100644 --- a/test/merge.js +++ b/test/merge.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect +var expect = require('must') , merge = require('../lib/merge') describe('merge', function() { @@ -8,7 +8,7 @@ describe('merge', function() { , bar = merge(foo) expect(foo).to.not.equal(bar) - expect(bar).to.have.key('wibble') + expect(bar).to.have.own('wibble') expect(bar.wibble).to.equal(1) }) }) @@ -21,7 +21,7 @@ describe('merge', function() { expect(m).to.not.equal(a) expect(m).to.not.equal(b) - expect(m).to.have.keys('foo', 'bar') + expect(m).to.have.keys(['foo', 'bar']) expect(m.foo).to.equal(1) expect(m.bar).to.equal(2) }) @@ -31,7 +31,7 @@ describe('merge', function() { , b = { foo: 2, bar: 3 } , m = merge(a, b) - expect(m).to.have.keys('foo', 'bar') + expect(m).to.have.keys(['foo', 'bar']) expect(m.foo).to.equal(2) expect(m.bar).to.equal(3) }) @@ -47,7 +47,7 @@ describe('merge', function() { expect(m).to.not.equal(a) expect(m).to.not.equal(b) expect(m).to.not.equal(c) - expect(m).to.have.keys('foo', 'bar', 'baz') + expect(m).to.have.keys(['foo', 'bar', 'baz']) expect(m.foo).to.equal(1) expect(m.bar).to.equal(2) expect(m.baz).to.equal(3) @@ -59,7 +59,7 @@ describe('merge', function() { , c = { baz: 5, foo: 6 } , m = merge(a, b, c) - expect(m).to.have.keys('foo', 'bar', 'baz') + expect(m).to.have.keys(['foo', 'bar', 'baz']) expect(m.foo).to.equal(6) expect(m.bar).to.equal(3) expect(m.baz).to.equal(5) diff --git a/test/not.js b/test/not.js index 751a27f..dc586bc 100644 --- a/test/not.js +++ b/test/not.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect +var expect = require('must') , each = require('../lib/each') , src = require('../lib/src') , not = require('../lib/not') diff --git a/test/nth.js b/test/nth.js index 03ccd58..a628f34 100644 --- a/test/nth.js +++ b/test/nth.js @@ -1,5 +1,5 @@ var partial = require('../lib/partial') - , expect = require('chai').expect + , expect = require('must') , nth = require('../lib/nth') describe('nth', function() { diff --git a/test/once.js b/test/once.js index 3f8f0cc..2fc107f 100644 --- a/test/once.js +++ b/test/once.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect +var expect = require('must') , once = require('../lib/once') describe('once', function() { @@ -6,7 +6,7 @@ describe('once', function() { var ofn = once(fn) it('should return another function named `once`', function() { - expect(ofn).to.be.a('function') + expect(ofn).to.be.a(Function) expect(ofn.name).to.equal('once') }) diff --git a/test/partial.js b/test/partial.js index cef630a..df132f5 100644 --- a/test/partial.js +++ b/test/partial.js @@ -1,4 +1,4 @@ -var expect = require("chai").expect +var expect = require("must") , $ = require("../lib/partial") describe("`partial`", function() { diff --git a/test/pipe.js b/test/pipe.js index 3b31bad..9866990 100644 --- a/test/pipe.js +++ b/test/pipe.js @@ -1,5 +1,5 @@ var partial = require('../lib/partial') - , expect = require('chai').expect + , expect = require('must') , pipe = require('../lib/pipe') describe('pipe', function() { diff --git a/test/range.js b/test/range.js index b61f915..f2df1fe 100644 --- a/test/range.js +++ b/test/range.js @@ -64,7 +64,7 @@ describe('range', function() { }) }) -var expect = require('chai').expect +var expect = require('must') , range = require('../lib/range') , each = require('../lib/each') , take = require('../lib/take') diff --git a/test/repeatedly.js b/test/repeatedly.js index cc1f960..cb90ca0 100644 --- a/test/repeatedly.js +++ b/test/repeatedly.js @@ -1,6 +1,6 @@ var repeatedly = require('../lib/repeatedly') , partial = require('../lib/partial') - , expect = require('chai').expect + , expect = require('must') , range = require('../lib/range') , each = require('../lib/each') , nth = require('../lib/nth') diff --git a/test/seq.js b/test/seq.js index 40e819c..25d1191 100644 --- a/test/seq.js +++ b/test/seq.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect +var expect = require('must') , count = require('../lib/count') , each = require('../lib/each') , take = require('../lib/take') @@ -86,7 +86,7 @@ describe('seq', function() { describe('when given a string with unicode shenanigans', function() { it('should make a sequence of characters where code pairs are considered', function() { var chr = ['I', 'ñ', 't', 'ë', 'r', 'n', 'â', 't', 'i', 'ô', 'n', 'à', 'l', 'i', 'z', 'æ', 't', 'i', 'ø', 'n', '☃', '💩'] - , str = seq(chr.join('')) + , str = seq(chr.join('')) expect(str.length).to.eql(chr.length) @@ -114,7 +114,7 @@ describe('seq', function() { var s = seq(Math.random) each(take(5, s), function(n) { - expect(n).to.be.within(0, 1) + expect(n).to.be.between(0, 1) }) }) }) diff --git a/test/slice.js b/test/slice.js index 20c018c..8a7b9e8 100644 --- a/test/slice.js +++ b/test/slice.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect +var expect = require('must') , slice = require('../lib/slice') , each = require('../lib/each') diff --git a/test/src.js b/test/src.js index 7288f8c..17c456f 100644 --- a/test/src.js +++ b/test/src.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect +var expect = require('must') , each = require('../lib/each') , src = require('../lib/src') diff --git a/test/take.js b/test/take.js index 4bcfdeb..c137d48 100644 --- a/test/take.js +++ b/test/take.js @@ -1,5 +1,5 @@ var partial = require('../lib/partial') - , expect = require('chai').expect + , expect = require('must') , slice = require('../lib/slice') , each = require('../lib/each') , take = require('../lib/take') diff --git a/test/thunk.js b/test/thunk.js index 4a7371c..92deea5 100644 --- a/test/thunk.js +++ b/test/thunk.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect +var expect = require('must') , global = (function() { return this }()) , thunk = require('../lib/thunk') , each = require('../lib/each') @@ -10,7 +10,7 @@ describe('thunk', function() { it('should return a zero arity thunk', function() { var th = thunk(function() {}) - expect(th).to.be.a('function') + expect(th).to.be.a(Function) expect(th.length).to.equal(0) expect(th.name).to.equal('thunk') }) @@ -47,7 +47,7 @@ describe('thunk', function() { it('should return a zero arity thunk', function() { var th = thunk(function() {}) - expect(th).to.be.a('function') + expect(th).to.be.a(Function) expect(th.length).to.equal(0) }) @@ -84,7 +84,7 @@ describe('thunk', function() { describe('and more than one parameter', function() { it('should return a zero arity function', function() { var th = thunk(function() {}, 1, 2, 3) - expect(th).to.be.a('function') + expect(th).to.be.a(Function) expect(th.length).to.equal(0) expect(th.name).to.equal('thunk') }) @@ -217,7 +217,7 @@ describe('thunk', function() { it('should return a zero arity thunk', function() { var th = thunk(function() {}) - expect(th).to.be.a('function') + expect(th).to.be.a(Function) expect(th.length).to.equal(0) expect(th.name).to.equal('thunk') }) diff --git a/test/trampoline.js b/test/trampoline.js index 6438ce7..c3b313a 100644 --- a/test/trampoline.js +++ b/test/trampoline.js @@ -1,5 +1,5 @@ var trampoline = require('../lib/trampoline') - , expect = require('chai').expect + , expect = require('must') , thunk = require('../lib/thunk') , each = require('../lib/each') diff --git a/test/type.js b/test/type.js index aea02e0..8dead7a 100644 --- a/test/type.js +++ b/test/type.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect +var expect = require('must') , range = require('../lib/range') , type = require('../lib/type') , seq = require('../lib/seq') diff --git a/test/val.js b/test/val.js index 366a11a..e80f94b 100644 --- a/test/val.js +++ b/test/val.js @@ -1,5 +1,5 @@ var constantly = require('../lib/constantly') - , expect = require('chai').expect + , expect = require('must') , type = require('../lib/type') , val = require('../lib/val') diff --git a/test/variadic.js b/test/variadic.js index c53950a..1a31a02 100644 --- a/test/variadic.js +++ b/test/variadic.js @@ -1,5 +1,5 @@ var variadic = require('../lib/variadic') - , expect = require('chai').expect + , expect = require('must') , thunk = require('../lib/thunk') , range = require('../lib/range') , slice = require('../lib/slice') diff --git a/test/vec.js b/test/vec.js index 3d0c239..00b96bd 100644 --- a/test/vec.js +++ b/test/vec.js @@ -1,4 +1,4 @@ -var expect = require('chai').expect +var expect = require('must') , range = require('../lib/range') , each = require('../lib/each') , type = require('../lib/type')