Use should.eql to compare arrays

When trying to pass the  "Return Largest Numbers in Arrays" challenge, I seem to be unable to pass the provided tests. I'm not familiar with Chai, but it would seem that we need to switch to .eql rather than === or should.equal when comparing two arrays to deeply compare the values rather than comparing objects.
This commit is contained in:
itchytag
2015-01-28 18:35:06 -05:00
parent 63714b347c
commit ea24eae922

View File

@ -124,8 +124,8 @@
"challengeSeed": "function largestOfFour(arr) {\n // You can do this!\r\n return arr;\r\n}",
"tests": [
"expect(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])).to.be.a('array');",
"(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])).should.equals([5,27,39,1001]);",
"assert(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]) === [9,35,97,1000000]);"
"(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])).should.eql([5,27,39,1001]);",
"assert(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]).should.eql([9,35,97,1000000]));"
]
},