tj / should.js

BDD style assertions for node.js -- test framework agnostic
MIT License
2.75k stars 195 forks source link

using type #136

Closed rm-rf-etc closed 11 years ago

rm-rf-etc commented 11 years ago

The following fails for me, using mocha.

var should = require('should')

describe('using type', function(){ it('should work', function(){ 'my string'.should.have.type('string') }) })

0 passing (4ms) 1 failing

1) using type should work: TypeError: Object # has no method 'typeof' at Context. (/Users/MyName/www/rapid/vessel/test/test2.js:6:33) at Test.Runnable.run (/usr/local/lib/node_modules/mocha/lib/runnable.js:211:32) at Runner.runTest (/usr/local/lib/node_modules/mocha/lib/runner.js:358:10) at /usr/local/lib/node_modules/mocha/lib/runner.js:404:12 at next (/usr/local/lib/node_modules/mocha/lib/runner.js:284:14) at /usr/local/lib/node_modules/mocha/lib/runner.js:293:7 at next (/usr/local/lib/node_modules/mocha/lib/runner.js:237:23) at Object._onImmediate (/usr/local/lib/node_modules/mocha/lib/runner.js:261:5) at processImmediate as _immediateCallback

rm-rf-etc commented 11 years ago

while this works fine:

var should = require('should')

describe('using type', function(){ it('should work', function(){ (typeof 'my string' === 'string').should.have.true }) })

1 passing (3ms)

btd commented 11 years ago

Current docs for version 2.0.0 which is not published now to npmjs. It will be published i hope at this week. For version 1.x.x use this readme.