visionmedia / expresso

use mocha
http://visionmedia.github.com/expresso
759 stars 89 forks source link

assert.length not working with node 0.6.0 #152

Open renajohn opened 13 years ago

renajohn commented 13 years ago

When using assert.length, I have the following error:

expresso -s test/test-server.js

uncaught undefined: TypeError: Property 'length' of object function ok(value, message) {
  if (!!!value) fail(value, true, message, '==', assert.ok);
} is not a function
    at Object._onTimeout (test/test-server.js:31:14)
    at Timer.ontimeout (timers.js:84:39)

Property 'length' of object function ok(value, message) {
  if (!!!value) fail(value, true, message, '==', assert.ok);
} is not a function
TypeError: Property 'length' of object function ok(value, message) {
  if (!!!value) fail(value, true, message, '==', assert.ok);
} is not a function
    at Object._onTimeout (test/test-server.js:31:14)
    at Timer.ontimeout (timers.js:84:39)...
evantahler commented 12 years ago

bump

buritica commented 12 years ago

The assert.length method is not defined in node 0.6.0, test the array length instead:

var myArray = [1,2,3];
assert.equal(myArray.length,3);