Reputation: 75656
'use strict';
var should = require('should');
describe('wtf', function () {
it('compare arrays', function (done) {
[].should.equal([]);
});
});
My tests were working fine until I switched from node 10.26 installed from brew to nvm installed version of 10.33.
Here is the error:
AssertionError: expected [] to equal []
Expected :[]
Actual :[]
Upvotes: 0
Views: 127
Reputation: 2030
should( [actual] ).eql( [comapre] )
- deep comparsionThis will pass
it('compare arrays', function (done) {
var test = [];
should(test).eql([]);
done();
});
This will fail
it('compare arrays', function (done) {
var test = ['t'];
should(test).eql([]);
done();
});
Note: Remember to finish the
async
tests withdone()
Upvotes: 3