expresso
expresso copied to clipboard
assert.length not working with node 0.6.0
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)...
bump
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);