This commit is contained in:
Maxim Zhilyaev 2014-11-14 14:24:48 -08:00
Родитель 9e8125db51
Коммит 353479a902
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -22,13 +22,13 @@ exports.testUtils = {
do_check_eq : function do_check_eq(assert, actual, expected, text) {
assert.equal(actual, expected, text);
},
compareArrayOrderIrrelevant : function checkEqualityOfTwoArrays() {
//---why? Basically in the tests we have to compare an array of nested objects for equality. However, deepEqual takes
//into account the order, which we don't care about here
//---accepts: any number of arrays
//---returns: true or false
first_array = JSON.stringify(arguments[0].map(JSON.stringify).sort()) //take the first item from the array
for(let i=1;i<arguments.length;i++){ //iterate through the rest of them
if(JSON.stringify(arguments[i].map(JSON.stringify).sort()) != first_array){
@ -36,9 +36,9 @@ exports.testUtils = {
}
}
return true //all must be equal, return true
},
itemsHave : function itemsHave(items, data) {
for (let i in items) {
if(items[i] == data) return true;