We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a772b10 commit 0a0e85eCopy full SHA for 0a0e85e
lib/index.js
@@ -58,6 +58,10 @@ export class HtmlDiffer {
58
* @returns {Boolean}
59
*/
60
async isEqual(html1, html2) {
61
+ if (html1 === html2) {
62
+ return true;
63
+ }
64
+
65
const diff = await this.diffHtml(html1, html2);
66
67
return (diff.length === 1 && !diff[0].added && !diff[0].removed);
test/differ/isEqual.js
@@ -180,4 +180,11 @@ describe('\'isEqual\'', function() {
180
181
invalidPreset.must.throw(Error);
182
});
183
184
+ it('blank values are equal', async function() {
185
+ const htmlDiffer = new HtmlDiffer();
186
+ const isEqual = await htmlDiffer.isEqual('', '');
187
188
+ isEqual.must.be.true();
189
+ });
190
0 commit comments