// I have got an array;
//var resultArray = t.getElementsForTable(1);
var expectedArray = ['0'];
it("if expected array equal to the actual", function () {
assert.strictEqual(t.getElementsForTable(1), expectedArray);
});
Asked
Active
Viewed 85 times
-4

Gopinath Shiva
- 3,822
- 5
- 25
- 48

IvanPavliuk
- 1,460
- 1
- 21
- 16
-
Because `t.getElementsForTable(1);` will never be equal to `['0']`. – dfsq Aug 01 '16 at 11:07
-
How to compare 2 arrays, using unit-testing – IvanPavliuk Aug 01 '16 at 11:09
-
getElementsForTable(1) returns array - ["0"] !!! – IvanPavliuk Aug 01 '16 at 11:15
1 Answers
0
Use deep equal if you are trying to compare the values inside array.
.deepEqual(actual, expected, [message])

James
- 1,436
- 1
- 13
- 25