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);
Written by kanshuYokoo
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#