Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Apr 2, 2020
1 parent a82d1c6 commit 4d24272
Show file tree
Hide file tree
Showing 4 changed files with 1,491 additions and 2 deletions.
16 changes: 16 additions & 0 deletions test/helpers/helpers.js
Expand Up @@ -21,6 +21,22 @@ beforeEach(() => {
return result;
}
};
},
toEqualHtml: () => {
return {
compare: async(actual, expected) => {
const result = {};
result.pass = await htmlDiffer.isEqual(expected, actual);

if (result.pass) {
result.message = `Expected '${actual}' not to equal '${expected}'`;
} else {
const diff = await htmlDiffer.firstDiff(actual, expected);
result.message = `Expected: ${diff.expected}\n Actual: ${diff.actual}`;
}
return result;
}
};
}
});
});

0 comments on commit 4d24272

Please sign in to comment.