3r4h8a
Last Updated: March 12, 2018
·
189
· kanshuYokoo

Javascript. mocha assertion array.

When testing the javascript class method which return array.
Use assert.deepEqual instead of assert.equal or assert.strictEqual

const expected = [1, 2, 3];
const actual = testClass.getdata(); // return [1,2,3]
assert.deepEqual(expected, actual);