diff --git a/test/dom-parser.test.js b/test/dom-parser.test.js index b0948d556..e31aa185b 100644 --- a/test/dom-parser.test.js +++ b/test/dom-parser.test.js @@ -15,7 +15,7 @@ describe('DOMParser', () => { columnNumber: 1, lineNumber: 1, } - expect(options.locator).toEqual(expected) + expect(options.locator).toStrictEqual(expected) }) test('should store passed options.xmlns for default mime type', () => { @@ -25,7 +25,7 @@ describe('DOMParser', () => { // TODO: is there a simpler way to test this that doesn't involve invoking parseFromString? const actual = it.parseFromString('') - expect(actual.toString()).toEqual('') + expect(actual.toString()).toBe('') }) test('should store and modify passed options.xmlns for html mime type', () => { @@ -35,7 +35,7 @@ describe('DOMParser', () => { // TODO: is there a simpler way to test this that doesn't involve invoking parseFromString? it.parseFromString('', 'text/html') - expect(options.xmlns['']).toEqual('http://www.w3.org/1999/xhtml') + expect(options.xmlns['']).toBe('http://www.w3.org/1999/xhtml') }) }) @@ -45,7 +45,7 @@ describe('DOMParser', () => { const actual = new DOMParser().parseFromString(XML).toString() - expect(actual).toEqual(XML) + expect(actual).toBe(XML) }) test('should provide access to textContent and attribute values', () => { @@ -71,13 +71,13 @@ describe('DOMParser', () => { */ const textTags = document.getElementsByTagName('text') - expect(textTags.length).toEqual(3) + expect(textTags).toHaveLength(3) const expectedText = ['first', 'second', 'last'] for (let i = 0; i < textTags.length; i++) { const textTag = textTags[i] - expect(textTag.textContent).toEqual(expectedText[i]) - expect(textTag.getAttribute('top')).toEqual(`${i}`) + expect(textTag.textContent).toBe(expectedText[i]) + expect(textTag.getAttribute('top')).toBe(`${i}`) } }) }) diff --git a/test/parse/parse-element.test.js b/test/parse/parse-element.test.js index 487f16344..bafb25fe2 100644 --- a/test/parse/parse-element.test.js +++ b/test/parse/parse-element.test.js @@ -9,7 +9,7 @@ describe('XML Node Parse', () => { const actual = new DOMParser() .parseFromString(input, 'text/xml') .toString() - expect(actual).toEqual('') + expect(actual).toBe('') }) }) @@ -24,7 +24,7 @@ describe('XML Node Parse', () => { .parseFromString(input, 'text/xml') .toString() - expect(actual).toEqual('') + expect(actual).toBe('') }) }) describe('empty b', () => { @@ -36,7 +36,7 @@ describe('XML Node Parse', () => { ])('%s', (input) => { expect( new DOMParser().parseFromString(input, 'text/xml').toString() - ).toEqual('') + ).toBe('') }) }) @@ -61,7 +61,7 @@ describe('XML Node Parse', () => { .parseFromString(input, 'text/xml') .toString() - expect(actual).toEqual('') + expect(actual).toBe('') }) it('unclosed root tag will be closed', () => { diff --git a/test/xss.test.js b/test/xss.test.js index 533cea9f5..e5fd71a25 100644 --- a/test/xss.test.js +++ b/test/xss.test.js @@ -68,7 +68,7 @@ describe('xss test', () => { const actual = xss(html) - expect(actual).toEqual( + expect(actual).toBe( '
' ) })