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
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#