Skip to content

Commit

Permalink
test: Use toBe instead of toEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
karfau committed Jan 17, 2021
1 parent 5f1d3c9 commit 993a01b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/dom/clone.test.js
Expand Up @@ -26,6 +26,6 @@ describe('XML Namespace Parse', () => {
const n = doc1.importNode(doc2.documentElement, true)
doc1.documentElement.appendChild(n)
expect(doc1.toString()).toBe(doc3.toString())
expect(doc2.toString()).not.toEqual(doc3.toString())
expect(doc2.toString()).not.toBe(doc3.toString())

This comment has been minimized.

Copy link
@brodybits

brodybits Jan 17, 2021

Member

nit: I would have kept these not.toEqual which would be stricter than not.toBe.

This comment has been minimized.

Copy link
@karfau

karfau Jan 17, 2021

Author Member

I didn't mean t "sneak those in", it was only for consistency.
I'm not aware that there is a difference in behavior of those two when used with string literals. In which case would they be different?

})
})
4 changes: 2 additions & 2 deletions test/dom/element.test.js
Expand Up @@ -116,7 +116,7 @@ describe('XML Namespace Parse', () => {
const str4 = new XMLSerializer().serializeToString(doc4)
expect(str1).toBe(str2)
expect(str2).toBe(str3)
expect(str3).not.toEqual(str4)
expect(str3).not.toBe(str4)
expect(str3.length).toBe(str4.length)
})

Expand All @@ -138,7 +138,7 @@ describe('XML Namespace Parse', () => {
const str2 = new XMLSerializer().serializeToString(doc2)

expect(doc2.documentElement.lastChild.childNodes).toHaveLength(1)
expect(str1).not.toEqual(str2)
expect(str1).not.toBe(str2)
expect(str1).not.toHaveLength(str2.length)
const doc3 = new DOMParser().parseFromString(str2, 'text/xml')
doc3.documentElement.firstChild.appendChild(doc3.documentElement.lastChild)
Expand Down

0 comments on commit 993a01b

Please sign in to comment.