$ npm install chai
chai@3.4.1 ../../../../../node_modules/chai
├── assertion-error@1.0.1
├── type-detect@1.0.0
└── deep-eql@0.1.3 (type-detect@0.1.1)
前回のchai無し版を以下のように修正。
chai = require 'chai'
chai.should()
{Hoge} = require '../Hoge.coffee'
describe 'Hoge instance', ->
range1 = range2 = null
it 'should make correct Hoge instance', ->
range1 = Hoge.makeHoge 5, 10
range1.location.should.equal 5
range1.length.should.equal 10
テスト実行は前回と同じく
$ mocha --compilers coffee:coffee-script/register
でOK。