Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request #22 from mstade/must
Browse files Browse the repository at this point in the history
Get rid of chai and other dependencies in favor of must
  • Loading branch information
mstade committed Nov 21, 2014
2 parents b03ac88 + 22a2956 commit e2130c9
Show file tree
Hide file tree
Showing 35 changed files with 58 additions and 60 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
coverage
npm-debug.log
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
18 changes: 9 additions & 9 deletions test/apply.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand All @@ -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()
Expand All @@ -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()
}
Expand All @@ -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()
Expand All @@ -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')
4 changes: 2 additions & 2 deletions test/assert.js
Original file line number Diff line number Diff line change
@@ -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')
Expand All @@ -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)
})
Expand Down
2 changes: 1 addition & 1 deletion test/call.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
2 changes: 1 addition & 1 deletion test/compose.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var partial = require('../lib/partial')
, expect = require('chai').expect
, expect = require('must')
, comp = require('../lib/compose')

describe('compose', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/constantly.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var constantly = require('../lib/constantly')
, expect = require('chai').expect
, expect = require('must')
, each = require('../lib/each')
, src = require('../lib/src')

Expand Down
2 changes: 1 addition & 1 deletion test/count.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var partial = require('../lib/partial')
, expect = require('chai').expect
, expect = require('must')
, count = require('../lib/count')
, seq = require('../lib/seq')

Expand Down
2 changes: 1 addition & 1 deletion test/each.js
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
2 changes: 1 addition & 1 deletion test/eq.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var expect = require('chai').expect
var expect = require('must')
, each = require('../lib/each')
, eq = require('../lib/eq')

Expand Down
2 changes: 1 addition & 1 deletion test/get.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const partial = require('../lib/partial')
, expect = require('chai').expect
, expect = require('must')
, each = require('../lib/each')
, get = require('../lib/get')

Expand Down
2 changes: 1 addition & 1 deletion test/gt.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var expect = require('chai').expect
var expect = require('must')
, gt = require('../lib/gt')

describe('gt', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/identity.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/is.js
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
2 changes: 1 addition & 1 deletion test/isEmpty.js
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
2 changes: 1 addition & 1 deletion test/isnt.js
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
2 changes: 1 addition & 1 deletion test/lt.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var expect = require('chai').expect
var expect = require('must')
, lt = require('../lib/lt')

describe('lt', function() {
Expand Down
12 changes: 6 additions & 6 deletions test/merge.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var expect = require('chai').expect
var expect = require('must')
, merge = require('../lib/merge')

describe('merge', function() {
Expand All @@ -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)
})
})
Expand All @@ -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)
})
Expand All @@ -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)
})
Expand All @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/not.js
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
2 changes: 1 addition & 1 deletion test/nth.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var partial = require('../lib/partial')
, expect = require('chai').expect
, expect = require('must')
, nth = require('../lib/nth')

describe('nth', function() {
Expand Down
4 changes: 2 additions & 2 deletions test/once.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
var expect = require('chai').expect
var expect = require('must')
, once = require('../lib/once')

describe('once', function() {
describe('when given a function `fn`', 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')
})

Expand Down
2 changes: 1 addition & 1 deletion test/partial.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var expect = require("chai").expect
var expect = require("must")
, $ = require("../lib/partial")

describe("`partial`", function() {
Expand Down
2 changes: 1 addition & 1 deletion test/pipe.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var partial = require('../lib/partial')
, expect = require('chai').expect
, expect = require('must')
, pipe = require('../lib/pipe')

describe('pipe', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/range.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion test/repeatedly.js
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
6 changes: 3 additions & 3 deletions test/seq.js
Original file line number Diff line number Diff line change
@@ -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')
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)
})
})
})
Expand Down
2 changes: 1 addition & 1 deletion test/slice.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var expect = require('chai').expect
var expect = require('must')
, slice = require('../lib/slice')
, each = require('../lib/each')

Expand Down
2 changes: 1 addition & 1 deletion test/src.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var expect = require('chai').expect
var expect = require('must')
, each = require('../lib/each')
, src = require('../lib/src')

Expand Down
2 changes: 1 addition & 1 deletion test/take.js
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
10 changes: 5 additions & 5 deletions test/thunk.js
Original file line number Diff line number Diff line change
@@ -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')
Expand All @@ -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')
})
Expand Down Expand Up @@ -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)
})

Expand Down Expand Up @@ -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')
})
Expand Down Expand Up @@ -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')
})
Expand Down
2 changes: 1 addition & 1 deletion test/trampoline.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var trampoline = require('../lib/trampoline')
, expect = require('chai').expect
, expect = require('must')
, thunk = require('../lib/thunk')
, each = require('../lib/each')

Expand Down
2 changes: 1 addition & 1 deletion test/type.js
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
Loading

0 comments on commit e2130c9

Please sign in to comment.