Fixed formatting
This commit is contained in:
Родитель
9e8125db51
Коммит
353479a902
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче