expresso icon indicating copy to clipboard operation
expresso copied to clipboard

assert.length not working with node 0.6.0

Open renajohn opened this issue 13 years ago • 2 comments

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)...

renajohn avatar Nov 07 '11 08:11 renajohn

bump

evantahler avatar Dec 17 '11 19:12 evantahler

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);

buritica avatar Jan 12 '12 19:01 buritica