From f671185c56ea232323a9788daee184551bf06ef5 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 9 Apr 2022 16:33:01 -0400 Subject: [PATCH] chore: bump Jest ESLint plugin --- __tests__/api/base.test.js | 4 +- __tests__/api/bodyAttributes.test.js | 34 +++---- __tests__/api/htmlAttributes.test.js | 68 +++++++------- __tests__/api/link.test.js | 128 +++++++++++++------------- __tests__/api/meta.test.js | 60 ++++++------ __tests__/api/noscript.test.js | 4 +- __tests__/api/script.test.js | 16 ++-- __tests__/api/style.test.js | 4 +- __tests__/api/title.test.js | 6 +- __tests__/api/titleAttributes.test.js | 28 +++--- __tests__/deferred.js | 8 +- __tests__/misc.test.js | 18 ++-- __tests__/server/helmetData.test.js | 6 +- __tests__/server/server.test.js | 34 +++---- __tests__/server/title.test.js | 2 +- package.json | 8 +- yarn.lock | 127 +++++++++++++------------ 17 files changed, 280 insertions(+), 275 deletions(-) diff --git a/__tests__/api/base.test.js b/__tests__/api/base.test.js index d3d4c1f7..e012b17b 100644 --- a/__tests__/api/base.test.js +++ b/__tests__/api/base.test.js @@ -55,7 +55,7 @@ describe('base tag', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('href')).toEqual('http://mysite.com/public'); + expect(firstTag.getAttribute('href')).toBe('http://mysite.com/public'); expect(firstTag.outerHTML).toMatchSnapshot(); }); @@ -131,7 +131,7 @@ describe('base tag', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('href')).toEqual('http://mysite.com/public'); + expect(firstTag.getAttribute('href')).toBe('http://mysite.com/public'); expect(firstTag.outerHTML).toMatchSnapshot(); }); diff --git a/__tests__/api/bodyAttributes.test.js b/__tests__/api/bodyAttributes.test.js index 98f732ff..462834dc 100644 --- a/__tests__/api/bodyAttributes.test.js +++ b/__tests__/api/bodyAttributes.test.js @@ -59,9 +59,9 @@ describe('body attributes', () => { const bodyTag = document.body; - expect(bodyTag.getAttribute('class')).toEqual('myClassName'); - expect(bodyTag.getAttribute('tabindex')).toEqual('-1'); - expect(bodyTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('class,tabindex'); + expect(bodyTag.getAttribute('class')).toBe('myClassName'); + expect(bodyTag.getAttribute('tabindex')).toBe('-1'); + expect(bodyTag.getAttribute(HELMET_ATTRIBUTE)).toBe('class,tabindex'); }); it('sets attributes based on the deepest nested component', () => { @@ -78,8 +78,8 @@ describe('body attributes', () => { const bodyTag = document.body; - expect(bodyTag.getAttribute('lang')).toEqual('ja'); - expect(bodyTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('lang'); + expect(bodyTag.getAttribute('lang')).toBe('ja'); + expect(bodyTag.getAttribute(HELMET_ATTRIBUTE)).toBe('lang'); }); it('handles valueless attributes', () => { @@ -91,8 +91,8 @@ describe('body attributes', () => { const bodyTag = document.body; - expect(bodyTag.getAttribute('hidden')).toEqual('true'); - expect(bodyTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('hidden'); + expect(bodyTag.getAttribute('hidden')).toBe('true'); + expect(bodyTag.getAttribute(HELMET_ATTRIBUTE)).toBe('hidden'); }); it('clears body attributes that are handled within helmet', () => { @@ -127,10 +127,10 @@ describe('body attributes', () => { const bodyTag = document.body; expect(bodyTag.getAttribute('hidden')).toBeNull(); - expect(bodyTag.getAttribute('lang')).toEqual('ja'); - expect(bodyTag.getAttribute('id')).toEqual('body-tag'); - expect(bodyTag.getAttribute('title')).toEqual('body tag'); - expect(bodyTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('lang,id,title'); + expect(bodyTag.getAttribute('lang')).toBe('ja'); + expect(bodyTag.getAttribute('id')).toBe('body-tag'); + expect(bodyTag.getAttribute('title')).toBe('body tag'); + expect(bodyTag.getAttribute(HELMET_ATTRIBUTE)).toBe('lang,id,title'); }); it('updates with multiple additions and removals - all new', () => { @@ -150,9 +150,9 @@ describe('body attributes', () => { expect(bodyTag.getAttribute('hidden')).toBeNull(); expect(bodyTag.getAttribute('lang')).toBeNull(); - expect(bodyTag.getAttribute('id')).toEqual('body-tag'); - expect(bodyTag.getAttribute('title')).toEqual('body tag'); - expect(bodyTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('id,title'); + expect(bodyTag.getAttribute('id')).toBe('body-tag'); + expect(bodyTag.getAttribute('title')).toBe('body tag'); + expect(bodyTag.getAttribute(HELMET_ATTRIBUTE)).toBe('id,title'); }); describe('initialized outside of helmet', () => { @@ -166,7 +166,7 @@ describe('body attributes', () => { const bodyTag = document.body; - expect(bodyTag.getAttribute('test')).toEqual('test'); + expect(bodyTag.getAttribute('test')).toBe('test'); expect(bodyTag.getAttribute(HELMET_ATTRIBUTE)).toBeNull(); }); @@ -179,8 +179,8 @@ describe('body attributes', () => { const bodyTag = document.body; - expect(bodyTag.getAttribute('test')).toEqual('helmet-attr'); - expect(bodyTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('test'); + expect(bodyTag.getAttribute('test')).toBe('helmet-attr'); + expect(bodyTag.getAttribute(HELMET_ATTRIBUTE)).toBe('test'); }); it('attributes are cleared once managed in helmet', () => { diff --git a/__tests__/api/htmlAttributes.test.js b/__tests__/api/htmlAttributes.test.js index c925ffbd..89413abd 100644 --- a/__tests__/api/htmlAttributes.test.js +++ b/__tests__/api/htmlAttributes.test.js @@ -22,9 +22,9 @@ describe('html attributes', () => { const htmlTag = document.documentElement; - expect(htmlTag.getAttribute('class')).toEqual('myClassName'); - expect(htmlTag.getAttribute('lang')).toEqual('en'); - expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('class,lang'); + expect(htmlTag.getAttribute('class')).toBe('myClassName'); + expect(htmlTag.getAttribute('lang')).toBe('en'); + expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toBe('class,lang'); }); it('sets attributes based on the deepest nested component', () => { @@ -45,8 +45,8 @@ describe('html attributes', () => { const htmlTag = document.documentElement; - expect(htmlTag.getAttribute('lang')).toEqual('ja'); - expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('lang'); + expect(htmlTag.getAttribute('lang')).toBe('ja'); + expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toBe('lang'); }); it('handles valueless attributes', () => { @@ -60,8 +60,8 @@ describe('html attributes', () => { const htmlTag = document.documentElement; - expect(htmlTag.getAttribute('amp')).toEqual(''); - expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('amp'); + expect(htmlTag.getAttribute('amp')).toBe(''); + expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toBe('amp'); }); it('clears html attributes that are handled within helmet', () => { @@ -106,10 +106,10 @@ describe('html attributes', () => { const htmlTag = document.documentElement; expect(htmlTag.getAttribute('amp')).toBeNull(); - expect(htmlTag.getAttribute('lang')).toEqual('ja'); - expect(htmlTag.getAttribute('id')).toEqual('html-tag'); - expect(htmlTag.getAttribute('title')).toEqual('html tag'); - expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('lang,id,title'); + expect(htmlTag.getAttribute('lang')).toBe('ja'); + expect(htmlTag.getAttribute('id')).toBe('html-tag'); + expect(htmlTag.getAttribute('title')).toBe('html tag'); + expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toBe('lang,id,title'); }); it('updates with multiple additions and removals - all new', () => { @@ -135,9 +135,9 @@ describe('html attributes', () => { expect(htmlTag.getAttribute('amp')).toBeNull(); expect(htmlTag.getAttribute('lang')).toBeNull(); - expect(htmlTag.getAttribute('id')).toEqual('html-tag'); - expect(htmlTag.getAttribute('title')).toEqual('html tag'); - expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('id,title'); + expect(htmlTag.getAttribute('id')).toBe('html-tag'); + expect(htmlTag.getAttribute('title')).toBe('html tag'); + expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toBe('id,title'); }); describe('initialized outside of helmet', () => { @@ -151,7 +151,7 @@ describe('html attributes', () => { const htmlTag = document.documentElement; - expect(htmlTag.getAttribute('test')).toEqual('test'); + expect(htmlTag.getAttribute('test')).toBe('test'); expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toBeNull(); }); @@ -166,8 +166,8 @@ describe('html attributes', () => { const htmlTag = document.documentElement; - expect(htmlTag.getAttribute('test')).toEqual('helmet-attr'); - expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('test'); + expect(htmlTag.getAttribute('test')).toBe('helmet-attr'); + expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toBe('test'); }); it('attributes are cleared once managed in helmet', () => { @@ -199,9 +199,9 @@ describe('html attributes', () => { const htmlTag = document.documentElement; - expect(htmlTag.getAttribute('class')).toEqual('myClassName'); - expect(htmlTag.getAttribute('lang')).toEqual('en'); - expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('class,lang'); + expect(htmlTag.getAttribute('class')).toBe('myClassName'); + expect(htmlTag.getAttribute('lang')).toBe('en'); + expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toBe('class,lang'); }); it('sets attributes based on the deepest nested component', () => { @@ -218,8 +218,8 @@ describe('html attributes', () => { const htmlTag = document.documentElement; - expect(htmlTag.getAttribute('lang')).toEqual('ja'); - expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('lang'); + expect(htmlTag.getAttribute('lang')).toBe('ja'); + expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toBe('lang'); }); it('handles valueless attributes', () => { @@ -231,8 +231,8 @@ describe('html attributes', () => { const htmlTag = document.documentElement; - expect(htmlTag.getAttribute('amp')).toEqual('true'); - expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('amp'); + expect(htmlTag.getAttribute('amp')).toBe('true'); + expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toBe('amp'); }); it('clears html attributes that are handled within helmet', () => { @@ -267,10 +267,10 @@ describe('html attributes', () => { const htmlTag = document.documentElement; expect(htmlTag.getAttribute('amp')).toBeNull(); - expect(htmlTag.getAttribute('lang')).toEqual('ja'); - expect(htmlTag.getAttribute('id')).toEqual('html-tag'); - expect(htmlTag.getAttribute('title')).toEqual('html tag'); - expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('lang,id,title'); + expect(htmlTag.getAttribute('lang')).toBe('ja'); + expect(htmlTag.getAttribute('id')).toBe('html-tag'); + expect(htmlTag.getAttribute('title')).toBe('html tag'); + expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toBe('lang,id,title'); }); it('updates with multiple additions and removals - all new', () => { @@ -290,9 +290,9 @@ describe('html attributes', () => { expect(htmlTag.getAttribute('amp')).toBeNull(); expect(htmlTag.getAttribute('lang')).toBeNull(); - expect(htmlTag.getAttribute('id')).toEqual('html-tag'); - expect(htmlTag.getAttribute('title')).toEqual('html tag'); - expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('id,title'); + expect(htmlTag.getAttribute('id')).toBe('html-tag'); + expect(htmlTag.getAttribute('title')).toBe('html tag'); + expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toBe('id,title'); }); describe('initialized outside of helmet', () => { @@ -306,7 +306,7 @@ describe('html attributes', () => { const htmlTag = document.documentElement; - expect(htmlTag.getAttribute('test')).toEqual('test'); + expect(htmlTag.getAttribute('test')).toBe('test'); expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toBeNull(); }); @@ -319,8 +319,8 @@ describe('html attributes', () => { const htmlTag = document.documentElement; - expect(htmlTag.getAttribute('test')).toEqual('helmet-attr'); - expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('test'); + expect(htmlTag.getAttribute('test')).toBe('helmet-attr'); + expect(htmlTag.getAttribute(HELMET_ATTRIBUTE)).toBe('test'); }); it('cleared once it is managed in helmet', () => { diff --git a/__tests__/api/link.test.js b/__tests__/api/link.test.js index 2029742c..90cfc11b 100644 --- a/__tests__/api/link.test.js +++ b/__tests__/api/link.test.js @@ -113,8 +113,8 @@ describe('link tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('rel')).toEqual('canonical'); - expect(firstTag.getAttribute('href')).toEqual('http://localhost/helmet/newest'); + expect(firstTag.getAttribute('rel')).toBe('canonical'); + expect(firstTag.getAttribute('href')).toBe('http://localhost/helmet/newest'); expect(firstTag.outerHTML).toMatchSnapshot(); }); @@ -154,18 +154,18 @@ describe('link tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('href')).toEqual('http://localhost/style.css'); - expect(firstTag.getAttribute('rel')).toEqual('stylesheet'); - expect(firstTag.getAttribute('type')).toEqual('text/css'); - expect(firstTag.getAttribute('media')).toEqual('all'); + expect(firstTag.getAttribute('href')).toBe('http://localhost/style.css'); + expect(firstTag.getAttribute('rel')).toBe('stylesheet'); + expect(firstTag.getAttribute('type')).toBe('text/css'); + expect(firstTag.getAttribute('media')).toBe('all'); expect(firstTag.outerHTML).toMatchSnapshot(); expect(secondTag).toBeInstanceOf(Element); expect(secondTag.getAttribute).toBeDefined(); - expect(secondTag.getAttribute('rel')).toEqual('stylesheet'); - expect(secondTag.getAttribute('href')).toEqual('http://localhost/inner.css'); - expect(secondTag.getAttribute('type')).toEqual('text/css'); - expect(secondTag.getAttribute('media')).toEqual('all'); + expect(secondTag.getAttribute('rel')).toBe('stylesheet'); + expect(secondTag.getAttribute('href')).toBe('http://localhost/inner.css'); + expect(secondTag.getAttribute('type')).toBe('text/css'); + expect(secondTag.getAttribute('media')).toBe('all'); expect(secondTag.outerHTML).toMatchSnapshot(); }); @@ -214,24 +214,24 @@ describe('link tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('href')).toEqual('http://localhost/style.css'); - expect(firstTag.getAttribute('rel')).toEqual('stylesheet'); - expect(firstTag.getAttribute('type')).toEqual('text/css'); - expect(firstTag.getAttribute('media')).toEqual('all'); + expect(firstTag.getAttribute('href')).toBe('http://localhost/style.css'); + expect(firstTag.getAttribute('rel')).toBe('stylesheet'); + expect(firstTag.getAttribute('type')).toBe('text/css'); + expect(firstTag.getAttribute('media')).toBe('all'); expect(firstTag.outerHTML).toMatchSnapshot(); expect(secondTag).toBeInstanceOf(Element); expect(secondTag.getAttribute).toBeDefined(); - expect(secondTag.getAttribute('href')).toEqual('http://localhost/helmet/innercomponent'); - expect(secondTag.getAttribute('rel')).toEqual('canonical'); + expect(secondTag.getAttribute('href')).toBe('http://localhost/helmet/innercomponent'); + expect(secondTag.getAttribute('rel')).toBe('canonical'); expect(secondTag.outerHTML).toMatchSnapshot(); expect(thirdTag).toBeInstanceOf(Element); expect(thirdTag.getAttribute).toBeDefined(); - expect(thirdTag.getAttribute('href')).toEqual('http://localhost/inner.css'); - expect(thirdTag.getAttribute('rel')).toEqual('stylesheet'); - expect(thirdTag.getAttribute('type')).toEqual('text/css'); - expect(thirdTag.getAttribute('media')).toEqual('all'); + expect(thirdTag.getAttribute('href')).toBe('http://localhost/inner.css'); + expect(thirdTag.getAttribute('rel')).toBe('stylesheet'); + expect(thirdTag.getAttribute('type')).toBe('text/css'); + expect(thirdTag.getAttribute('media')).toBe('all'); expect(thirdTag.outerHTML).toMatchSnapshot(); }); @@ -261,14 +261,14 @@ describe('link tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('rel')).toEqual('canonical'); - expect(firstTag.getAttribute('href')).toEqual('http://localhost/helmet'); + expect(firstTag.getAttribute('rel')).toBe('canonical'); + expect(firstTag.getAttribute('href')).toBe('http://localhost/helmet'); expect(firstTag.outerHTML).toMatchSnapshot(); expect(secondTag).toBeInstanceOf(Element); expect(secondTag.getAttribute).toBeDefined(); - expect(secondTag.getAttribute('rel')).toEqual('canonical'); - expect(secondTag.getAttribute('href')).toEqual('http://localhost/helmet/component'); + expect(secondTag.getAttribute('rel')).toBe('canonical'); + expect(secondTag.getAttribute('href')).toBe('http://localhost/helmet/component'); expect(secondTag.outerHTML).toMatchSnapshot(); }); @@ -307,8 +307,8 @@ describe('link tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('rel')).toEqual('canonical'); - expect(firstTag.getAttribute('href')).toEqual('http://localhost/helmet/innercomponent'); + expect(firstTag.getAttribute('rel')).toBe('canonical'); + expect(firstTag.getAttribute('href')).toBe('http://localhost/helmet/innercomponent'); expect(firstTag.outerHTML).toMatchSnapshot(); }); @@ -348,14 +348,14 @@ describe('link tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('rel')).toEqual('canonical'); - expect(firstTag.getAttribute('href')).toEqual('http://localhost/helmet/component'); + expect(firstTag.getAttribute('rel')).toBe('canonical'); + expect(firstTag.getAttribute('href')).toBe('http://localhost/helmet/component'); expect(firstTag.outerHTML).toMatchSnapshot(); expect(secondTag).toBeInstanceOf(Element); expect(secondTag.getAttribute).toBeDefined(); - expect(secondTag.getAttribute('rel')).toEqual('canonical'); - expect(secondTag.getAttribute('href')).toEqual('http://localhost/helmet/innercomponent'); + expect(secondTag.getAttribute('rel')).toBe('canonical'); + expect(secondTag.getAttribute('href')).toBe('http://localhost/helmet/innercomponent'); expect(secondTag.outerHTML).toMatchSnapshot(); }); @@ -381,8 +381,8 @@ describe('link tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('rel')).toEqual('canonical'); - expect(firstTag.getAttribute('href')).toEqual('http://localhost/helmet/component'); + expect(firstTag.getAttribute('rel')).toBe('canonical'); + expect(firstTag.getAttribute('href')).toBe('http://localhost/helmet/component'); expect(firstTag.outerHTML).toMatchSnapshot(); }); }); @@ -469,8 +469,8 @@ describe('link tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('rel')).toEqual('canonical'); - expect(firstTag.getAttribute('href')).toEqual('http://localhost/helmet/newest'); + expect(firstTag.getAttribute('rel')).toBe('canonical'); + expect(firstTag.getAttribute('href')).toBe('http://localhost/helmet/newest'); expect(firstTag.outerHTML).toMatchSnapshot(); }); @@ -496,18 +496,18 @@ describe('link tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('href')).toEqual('http://localhost/style.css'); - expect(firstTag.getAttribute('rel')).toEqual('stylesheet'); - expect(firstTag.getAttribute('type')).toEqual('text/css'); - expect(firstTag.getAttribute('media')).toEqual('all'); + expect(firstTag.getAttribute('href')).toBe('http://localhost/style.css'); + expect(firstTag.getAttribute('rel')).toBe('stylesheet'); + expect(firstTag.getAttribute('type')).toBe('text/css'); + expect(firstTag.getAttribute('media')).toBe('all'); expect(firstTag.outerHTML).toMatchSnapshot(); expect(secondTag).toBeInstanceOf(Element); expect(secondTag.getAttribute).toBeDefined(); - expect(secondTag.getAttribute('rel')).toEqual('stylesheet'); - expect(secondTag.getAttribute('href')).toEqual('http://localhost/inner.css'); - expect(secondTag.getAttribute('type')).toEqual('text/css'); - expect(secondTag.getAttribute('media')).toEqual('all'); + expect(secondTag.getAttribute('rel')).toBe('stylesheet'); + expect(secondTag.getAttribute('href')).toBe('http://localhost/inner.css'); + expect(secondTag.getAttribute('type')).toBe('text/css'); + expect(secondTag.getAttribute('media')).toBe('all'); expect(secondTag.outerHTML).toMatchSnapshot(); }); @@ -536,24 +536,24 @@ describe('link tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('href')).toEqual('http://localhost/style.css'); - expect(firstTag.getAttribute('rel')).toEqual('stylesheet'); - expect(firstTag.getAttribute('type')).toEqual('text/css'); - expect(firstTag.getAttribute('media')).toEqual('all'); + expect(firstTag.getAttribute('href')).toBe('http://localhost/style.css'); + expect(firstTag.getAttribute('rel')).toBe('stylesheet'); + expect(firstTag.getAttribute('type')).toBe('text/css'); + expect(firstTag.getAttribute('media')).toBe('all'); expect(firstTag.outerHTML).toMatchSnapshot(); expect(secondTag).toBeInstanceOf(Element); expect(secondTag.getAttribute).toBeDefined(); - expect(secondTag.getAttribute('href')).toEqual('http://localhost/helmet/innercomponent'); - expect(secondTag.getAttribute('rel')).toEqual('canonical'); + expect(secondTag.getAttribute('href')).toBe('http://localhost/helmet/innercomponent'); + expect(secondTag.getAttribute('rel')).toBe('canonical'); expect(secondTag.outerHTML).toMatchSnapshot(); expect(thirdTag).toBeInstanceOf(Element); expect(thirdTag.getAttribute).toBeDefined(); - expect(thirdTag.getAttribute('href')).toEqual('http://localhost/inner.css'); - expect(thirdTag.getAttribute('rel')).toEqual('stylesheet'); - expect(thirdTag.getAttribute('type')).toEqual('text/css'); - expect(thirdTag.getAttribute('media')).toEqual('all'); + expect(thirdTag.getAttribute('href')).toBe('http://localhost/inner.css'); + expect(thirdTag.getAttribute('rel')).toBe('stylesheet'); + expect(thirdTag.getAttribute('type')).toBe('text/css'); + expect(thirdTag.getAttribute('media')).toBe('all'); expect(thirdTag.outerHTML).toMatchSnapshot(); }); @@ -575,14 +575,14 @@ describe('link tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('rel')).toEqual('canonical'); - expect(firstTag.getAttribute('href')).toEqual('http://localhost/helmet'); + expect(firstTag.getAttribute('rel')).toBe('canonical'); + expect(firstTag.getAttribute('href')).toBe('http://localhost/helmet'); expect(firstTag.outerHTML).toMatchSnapshot(); expect(secondTag).toBeInstanceOf(Element); expect(secondTag.getAttribute).toBeDefined(); - expect(secondTag.getAttribute('rel')).toEqual('canonical'); - expect(secondTag.getAttribute('href')).toEqual('http://localhost/helmet/component'); + expect(secondTag.getAttribute('rel')).toBe('canonical'); + expect(secondTag.getAttribute('href')).toBe('http://localhost/helmet/component'); expect(secondTag.outerHTML).toMatchSnapshot(); }); @@ -608,8 +608,8 @@ describe('link tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('rel')).toEqual('canonical'); - expect(firstTag.getAttribute('href')).toEqual('http://localhost/helmet/innercomponent'); + expect(firstTag.getAttribute('rel')).toBe('canonical'); + expect(firstTag.getAttribute('href')).toBe('http://localhost/helmet/innercomponent'); expect(firstTag.outerHTML).toMatchSnapshot(); }); @@ -636,14 +636,14 @@ describe('link tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('rel')).toEqual('canonical'); - expect(firstTag.getAttribute('href')).toEqual('http://localhost/helmet/component'); + expect(firstTag.getAttribute('rel')).toBe('canonical'); + expect(firstTag.getAttribute('href')).toBe('http://localhost/helmet/component'); expect(firstTag.outerHTML).toMatchSnapshot(); expect(secondTag).toBeInstanceOf(Element); expect(secondTag.getAttribute).toBeDefined(); - expect(secondTag.getAttribute('rel')).toEqual('canonical'); - expect(secondTag.getAttribute('href')).toEqual('http://localhost/helmet/innercomponent'); + expect(secondTag.getAttribute('rel')).toBe('canonical'); + expect(secondTag.getAttribute('href')).toBe('http://localhost/helmet/innercomponent'); expect(secondTag.outerHTML).toMatchSnapshot(); }); @@ -664,8 +664,8 @@ describe('link tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('rel')).toEqual('canonical'); - expect(firstTag.getAttribute('href')).toEqual('http://localhost/helmet/component'); + expect(firstTag.getAttribute('rel')).toBe('canonical'); + expect(firstTag.getAttribute('href')).toBe('http://localhost/helmet/component'); expect(firstTag.outerHTML).toMatchSnapshot(); }); }); diff --git a/__tests__/api/meta.test.js b/__tests__/api/meta.test.js index adaf4b80..88bd2e70 100644 --- a/__tests__/api/meta.test.js +++ b/__tests__/api/meta.test.js @@ -105,19 +105,19 @@ describe('meta tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('charset')).toEqual('utf-8'); + expect(firstTag.getAttribute('charset')).toBe('utf-8'); expect(firstTag.outerHTML).toMatchSnapshot(); expect(secondTag).toBeInstanceOf(Element); expect(secondTag.getAttribute).toBeDefined(); - expect(secondTag.getAttribute('name')).toEqual('description'); - expect(secondTag.getAttribute('content')).toEqual('Inner description'); + expect(secondTag.getAttribute('name')).toBe('description'); + expect(secondTag.getAttribute('content')).toBe('Inner description'); expect(secondTag.outerHTML).toMatchSnapshot(); expect(thirdTag).toBeInstanceOf(Element); expect(thirdTag.getAttribute).toBeDefined(); - expect(thirdTag.getAttribute('name')).toEqual('keywords'); - expect(thirdTag.getAttribute('content')).toEqual('test,meta,tags'); + expect(thirdTag.getAttribute('name')).toBe('keywords'); + expect(thirdTag.getAttribute('content')).toBe('test,meta,tags'); expect(thirdTag.outerHTML).toMatchSnapshot(); }); @@ -147,14 +147,14 @@ describe('meta tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('name')).toEqual('description'); - expect(firstTag.getAttribute('content')).toEqual('Test description'); + expect(firstTag.getAttribute('name')).toBe('description'); + expect(firstTag.getAttribute('content')).toBe('Test description'); expect(firstTag.outerHTML).toMatchSnapshot(); expect(secondTag).toBeInstanceOf(Element); expect(secondTag.getAttribute).toBeDefined(); - expect(secondTag.getAttribute('name')).toEqual('description'); - expect(secondTag.getAttribute('content')).toEqual('Duplicate description'); + expect(secondTag.getAttribute('name')).toBe('description'); + expect(secondTag.getAttribute('content')).toBe('Duplicate description'); expect(secondTag.outerHTML).toMatchSnapshot(); }); @@ -193,8 +193,8 @@ describe('meta tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('name')).toEqual('description'); - expect(firstTag.getAttribute('content')).toEqual('Inner description'); + expect(firstTag.getAttribute('name')).toBe('description'); + expect(firstTag.getAttribute('content')).toBe('Inner description'); expect(firstTag.outerHTML).toMatchSnapshot(); }); @@ -234,14 +234,14 @@ describe('meta tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('name')).toEqual('description'); - expect(firstTag.getAttribute('content')).toEqual('Inner description'); + expect(firstTag.getAttribute('name')).toBe('description'); + expect(firstTag.getAttribute('content')).toBe('Inner description'); expect(firstTag.outerHTML).toMatchSnapshot(); expect(secondTag).toBeInstanceOf(Element); expect(secondTag.getAttribute).toBeDefined(); - expect(secondTag.getAttribute('name')).toEqual('description'); - expect(secondTag.getAttribute('content')).toEqual('Inner duplicate description'); + expect(secondTag.getAttribute('name')).toBe('description'); + expect(secondTag.getAttribute('content')).toBe('Inner duplicate description'); expect(secondTag.outerHTML).toMatchSnapshot(); }); @@ -371,19 +371,19 @@ describe('meta tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('charset')).toEqual('utf-8'); + expect(firstTag.getAttribute('charset')).toBe('utf-8'); expect(firstTag.outerHTML).toMatchSnapshot(); expect(secondTag).toBeInstanceOf(Element); expect(secondTag.getAttribute).toBeDefined(); - expect(secondTag.getAttribute('name')).toEqual('description'); - expect(secondTag.getAttribute('content')).toEqual('Inner description'); + expect(secondTag.getAttribute('name')).toBe('description'); + expect(secondTag.getAttribute('content')).toBe('Inner description'); expect(secondTag.outerHTML).toMatchSnapshot(); expect(thirdTag).toBeInstanceOf(Element); expect(thirdTag.getAttribute).toBeDefined(); - expect(thirdTag.getAttribute('name')).toEqual('keywords'); - expect(thirdTag.getAttribute('content')).toEqual('test,meta,tags'); + expect(thirdTag.getAttribute('name')).toBe('keywords'); + expect(thirdTag.getAttribute('content')).toBe('test,meta,tags'); expect(thirdTag.outerHTML).toMatchSnapshot(); }); @@ -405,14 +405,14 @@ describe('meta tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('name')).toEqual('description'); - expect(firstTag.getAttribute('content')).toEqual('Test description'); + expect(firstTag.getAttribute('name')).toBe('description'); + expect(firstTag.getAttribute('content')).toBe('Test description'); expect(firstTag.outerHTML).toMatchSnapshot(); expect(secondTag).toBeInstanceOf(Element); expect(secondTag.getAttribute).toBeDefined(); - expect(secondTag.getAttribute('name')).toEqual('description'); - expect(secondTag.getAttribute('content')).toEqual('Duplicate description'); + expect(secondTag.getAttribute('name')).toBe('description'); + expect(secondTag.getAttribute('content')).toBe('Duplicate description'); expect(secondTag.outerHTML).toMatchSnapshot(); }); @@ -438,8 +438,8 @@ describe('meta tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('name')).toEqual('description'); - expect(firstTag.getAttribute('content')).toEqual('Inner description'); + expect(firstTag.getAttribute('name')).toBe('description'); + expect(firstTag.getAttribute('content')).toBe('Inner description'); expect(firstTag.outerHTML).toMatchSnapshot(); }); @@ -466,14 +466,14 @@ describe('meta tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('name')).toEqual('description'); - expect(firstTag.getAttribute('content')).toEqual('Inner description'); + expect(firstTag.getAttribute('name')).toBe('description'); + expect(firstTag.getAttribute('content')).toBe('Inner description'); expect(firstTag.outerHTML).toMatchSnapshot(); expect(secondTag).toBeInstanceOf(Element); expect(secondTag.getAttribute).toBeDefined(); - expect(secondTag.getAttribute('name')).toEqual('description'); - expect(secondTag.getAttribute('content')).toEqual('Inner duplicate description'); + expect(secondTag.getAttribute('name')).toBe('description'); + expect(secondTag.getAttribute('content')).toBe('Inner duplicate description'); expect(secondTag.outerHTML).toMatchSnapshot(); }); diff --git a/__tests__/api/noscript.test.js b/__tests__/api/noscript.test.js index e5bcd9fb..e97180ab 100644 --- a/__tests__/api/noscript.test.js +++ b/__tests__/api/noscript.test.js @@ -23,7 +23,7 @@ describe('noscript tags', () => { expect(existingTags).toBeDefined(); expect(existingTags).toHaveLength(1); - expect(existingTags[0].id).toEqual('bar'); + expect(existingTags[0].id).toBe('bar'); expect(existingTags[0].outerHTML).toMatchSnapshot(); }); @@ -77,7 +77,7 @@ describe('noscript tags', () => { expect(existingTags).toBeDefined(); expect(existingTags).toHaveLength(1); - expect(existingTags[0].id).toEqual('bar'); + expect(existingTags[0].id).toBe('bar'); expect(existingTags[0].outerHTML).toMatchSnapshot(); }); diff --git a/__tests__/api/script.test.js b/__tests__/api/script.test.js index 24d6e2b5..f6ff7ad2 100644 --- a/__tests__/api/script.test.js +++ b/__tests__/api/script.test.js @@ -114,14 +114,14 @@ describe('script tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('src')).toEqual('http://localhost/test.js'); - expect(firstTag.getAttribute('type')).toEqual('text/javascript'); + expect(firstTag.getAttribute('src')).toBe('http://localhost/test.js'); + expect(firstTag.getAttribute('type')).toBe('text/javascript'); expect(firstTag.outerHTML).toMatchSnapshot(); expect(secondTag).toBeInstanceOf(Element); expect(secondTag.getAttribute).toBeDefined(); - expect(secondTag.getAttribute('src')).toEqual('http://localhost/test2.js'); - expect(secondTag.getAttribute('type')).toEqual('text/javascript'); + expect(secondTag.getAttribute('src')).toBe('http://localhost/test2.js'); + expect(secondTag.getAttribute('type')).toBe('text/javascript'); expect(secondTag.outerHTML).toMatchSnapshot(); }); @@ -263,14 +263,14 @@ describe('script tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('src')).toEqual('http://localhost/test.js'); - expect(firstTag.getAttribute('type')).toEqual('text/javascript'); + expect(firstTag.getAttribute('src')).toBe('http://localhost/test.js'); + expect(firstTag.getAttribute('type')).toBe('text/javascript'); expect(firstTag.outerHTML).toMatchSnapshot(); expect(secondTag).toBeInstanceOf(Element); expect(secondTag.getAttribute).toBeDefined(); - expect(secondTag.getAttribute('src')).toEqual('http://localhost/test2.js'); - expect(secondTag.getAttribute('type')).toEqual('text/javascript'); + expect(secondTag.getAttribute('src')).toBe('http://localhost/test2.js'); + expect(secondTag.getAttribute('type')).toBe('text/javascript'); expect(secondTag.outerHTML).toMatchSnapshot(); }); diff --git a/__tests__/api/style.test.js b/__tests__/api/style.test.js index f2905893..86ef55a5 100644 --- a/__tests__/api/style.test.js +++ b/__tests__/api/style.test.js @@ -41,7 +41,7 @@ describe('style tags', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('type')).toEqual('text/css'); + expect(firstTag.getAttribute('type')).toBe('text/css'); expect(firstTag.innerHTML).toEqual(cssText1); expect(firstTag.outerHTML).toMatchSnapshot(); @@ -132,7 +132,7 @@ describe('Declarative API', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('type')).toEqual('text/css'); + expect(firstTag.getAttribute('type')).toBe('text/css'); expect(firstTag.innerHTML).toEqual(cssText1); expect(firstTag.outerHTML).toMatchSnapshot(); diff --git a/__tests__/api/title.test.js b/__tests__/api/title.test.js index 92b1f102..d731d917 100644 --- a/__tests__/api/title.test.js +++ b/__tests__/api/title.test.js @@ -135,7 +135,7 @@ describe('title', () => { const titleTag = document.getElementsByTagName('title')[0]; expect(document.title).toMatchSnapshot(); - expect(titleTag.getAttribute('itemprop')).toEqual('name'); + expect(titleTag.getAttribute('itemprop')).toBe('name'); }); }); @@ -302,7 +302,7 @@ describe('title', () => { const titleTag = document.getElementsByTagName('title')[0]; expect(document.title).toMatchSnapshot(); - expect(titleTag.getAttribute('itemprop')).toEqual('name'); + expect(titleTag.getAttribute('itemprop')).toBe('name'); }); it('retains existing title tag when no title tag is defined', () => { @@ -334,7 +334,7 @@ describe('title', () => { ); - expect(document.title).toEqual(''); + expect(document.title).toBe(''); }); }); }); diff --git a/__tests__/api/titleAttributes.test.js b/__tests__/api/titleAttributes.test.js index 221e43f2..fdda0d6b 100644 --- a/__tests__/api/titleAttributes.test.js +++ b/__tests__/api/titleAttributes.test.js @@ -22,8 +22,8 @@ describe('title attributes', () => { const titleTag = document.getElementsByTagName('title')[0]; - expect(titleTag.getAttribute('itemprop')).toEqual('name'); - expect(titleTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('itemprop'); + expect(titleTag.getAttribute('itemprop')).toBe('name'); + expect(titleTag.getAttribute(HELMET_ATTRIBUTE)).toBe('itemprop'); }); it('sets attributes based on the deepest nested component', () => { @@ -45,9 +45,9 @@ describe('title attributes', () => { const titleTag = document.getElementsByTagName('title')[0]; - expect(titleTag.getAttribute('lang')).toEqual('ja'); - expect(titleTag.getAttribute('hidden')).toEqual(''); - expect(titleTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('lang,hidden'); + expect(titleTag.getAttribute('lang')).toBe('ja'); + expect(titleTag.getAttribute('hidden')).toBe(''); + expect(titleTag.getAttribute(HELMET_ATTRIBUTE)).toBe('lang,hidden'); }); it('handles valueless attributes', () => { @@ -61,8 +61,8 @@ describe('title attributes', () => { const titleTag = document.getElementsByTagName('title')[0]; - expect(titleTag.getAttribute('hidden')).toEqual(''); - expect(titleTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('hidden'); + expect(titleTag.getAttribute('hidden')).toBe(''); + expect(titleTag.getAttribute(HELMET_ATTRIBUTE)).toBe('hidden'); }); it('clears title attributes that are handled within helmet', () => { @@ -95,8 +95,8 @@ describe('title attributes', () => { const titleTag = document.getElementsByTagName('title')[0]; - expect(titleTag.getAttribute('itemprop')).toEqual('name'); - expect(titleTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('itemprop'); + expect(titleTag.getAttribute('itemprop')).toBe('name'); + expect(titleTag.getAttribute(HELMET_ATTRIBUTE)).toBe('itemprop'); }); it('sets attributes based on the deepest nested component', () => { @@ -113,9 +113,9 @@ describe('title attributes', () => { const titleTag = document.getElementsByTagName('title')[0]; - expect(titleTag.getAttribute('lang')).toEqual('ja'); - expect(titleTag.getAttribute('hidden')).toEqual('true'); - expect(titleTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('lang,hidden'); + expect(titleTag.getAttribute('lang')).toBe('ja'); + expect(titleTag.getAttribute('hidden')).toBe('true'); + expect(titleTag.getAttribute(HELMET_ATTRIBUTE)).toBe('lang,hidden'); }); it('handles valueless attributes', () => { @@ -127,8 +127,8 @@ describe('title attributes', () => { const titleTag = document.getElementsByTagName('title')[0]; - expect(titleTag.getAttribute('hidden')).toEqual('true'); - expect(titleTag.getAttribute(HELMET_ATTRIBUTE)).toEqual('hidden'); + expect(titleTag.getAttribute('hidden')).toBe('true'); + expect(titleTag.getAttribute(HELMET_ATTRIBUTE)).toBe('hidden'); }); it('clears title attributes that are handled within helmet', () => { diff --git a/__tests__/deferred.js b/__tests__/deferred.js index 5dce2992..f83f7518 100644 --- a/__tests__/deferred.js +++ b/__tests__/deferred.js @@ -53,11 +53,11 @@ describe('deferred tags', () => { container ); - expect(window.__spy__.callCount).toEqual(1); + expect(window.__spy__.callCount).toBe(1); return new Promise(resolve => { requestAnimationFrame(() => { - expect(window.__spy__.callCount).toEqual(2); + expect(window.__spy__.callCount).toBe(2); expect(window.__spy__.args).toDeepEqual([[1], [2]]); resolve(); @@ -80,11 +80,11 @@ describe('deferred tags', () => { container ); - expect(window.__spy__.callCount).toEqual(1); + expect(window.__spy__.callCount).toBe(1); return new Promise(resolve => { requestAnimationFrame(() => { - expect(window.__spy__.callCount).toEqual(2); + expect(window.__spy__.callCount).toBe(2); expect(window.__spy__.args).toDeepEqual([[1], [2]]); resolve(); diff --git a/__tests__/misc.test.js b/__tests__/misc.test.js index caa64c81..144495ca 100644 --- a/__tests__/misc.test.js +++ b/__tests__/misc.test.js @@ -34,8 +34,8 @@ describe('misc', () => { expect(existingTag).toBeInstanceOf(Element); expect(existingTag.getAttribute).toBeDefined(); - expect(existingTag.getAttribute('name')).toEqual('description'); - expect(existingTag.getAttribute('content')).toEqual('This is "quoted" text and & and \'.'); + expect(existingTag.getAttribute('name')).toBe('description'); + expect(existingTag.getAttribute('content')).toBe('This is "quoted" text and & and \'.'); expect(existingTag.outerHTML).toMatchSnapshot(); }); @@ -188,8 +188,8 @@ describe('misc', () => { expect(existingTag).toBeInstanceOf(Element); expect(existingTag.getAttribute).toBeDefined(); - expect(existingTag.getAttribute('name')).toEqual('description'); - expect(existingTag.getAttribute('content')).toEqual('Test Description'); + expect(existingTag.getAttribute('name')).toBe('description'); + expect(existingTag.getAttribute('content')).toBe('Test Description'); expect(existingTag.outerHTML).toMatchSnapshot(); }); @@ -221,8 +221,8 @@ describe('misc', () => { expect(existingTag).toBeInstanceOf(Element); expect(existingTag.getAttribute).toBeDefined(); - expect(existingTag.getAttribute('name')).toEqual('description'); - expect(existingTag.getAttribute('content')).toEqual('This is "quoted" text and & and \'.'); + expect(existingTag.getAttribute('name')).toBe('description'); + expect(existingTag.getAttribute('content')).toBe('This is "quoted" text and & and \'.'); expect(existingTag.outerHTML).toMatchSnapshot(); }); @@ -443,7 +443,7 @@ describe('misc', () => { ); - expect(document.title).toEqual('Test Title'); + expect(document.title).toBe('Test Title'); }); it('recognizes valid tags regardless of attribute ordering', () => { @@ -461,8 +461,8 @@ describe('misc', () => { expect(existingTag).toBeInstanceOf(Element); expect(existingTag.getAttribute).toBeDefined(); - expect(existingTag.getAttribute('name')).toEqual('description'); - expect(existingTag.getAttribute('content')).toEqual('Test Description'); + expect(existingTag.getAttribute('name')).toBe('description'); + expect(existingTag.getAttribute('content')).toBe('Test Description'); expect(existingTag.outerHTML).toMatchSnapshot(); }); diff --git a/__tests__/server/helmetData.test.js b/__tests__/server/helmetData.test.js index d79520d5..867dcb7d 100644 --- a/__tests__/server/helmetData.test.js +++ b/__tests__/server/helmetData.test.js @@ -112,7 +112,7 @@ describe('Helmet Data', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('href')).toEqual('http://localhost/'); + expect(firstTag.getAttribute('href')).toBe('http://localhost/'); expect(firstTag.outerHTML).toMatchSnapshot(); }); @@ -133,7 +133,7 @@ describe('Helmet Data', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('href')).toEqual('http://localhost/'); + expect(firstTag.getAttribute('href')).toBe('http://localhost/'); expect(firstTag.outerHTML).toMatchSnapshot(); }); @@ -159,7 +159,7 @@ describe('Helmet Data', () => { expect(firstTag).toBeInstanceOf(Element); expect(firstTag.getAttribute).toBeDefined(); - expect(firstTag.getAttribute('href')).toEqual('http://mysite.com/public'); + expect(firstTag.getAttribute('href')).toBe('http://mysite.com/public'); expect(firstTag.outerHTML).toMatchSnapshot(); }); }); diff --git a/__tests__/server/server.test.js b/__tests__/server/server.test.js index fe9b02a0..856c9671 100644 --- a/__tests__/server/server.test.js +++ b/__tests__/server/server.test.js @@ -28,7 +28,7 @@ describe('server', () => { expect(head.htmlAttributes).toBeDefined(); expect(head.htmlAttributes.toString).toBeDefined(); - expect(head.htmlAttributes.toString()).toEqual(''); + expect(head.htmlAttributes.toString()).toBe(''); expect(head.htmlAttributes.toComponent).toBeDefined(); expect(head.htmlAttributes.toComponent()).toEqual({}); @@ -43,7 +43,7 @@ describe('server', () => { expect(head.base).toBeDefined(); expect(head.base.toString).toBeDefined(); - expect(head.base.toString()).toEqual(''); + expect(head.base.toString()).toBe(''); expect(head.base.toComponent).toBeDefined(); const baseComponent = head.base.toComponent(); @@ -53,7 +53,7 @@ describe('server', () => { expect(head.meta).toBeDefined(); expect(head.meta.toString).toBeDefined(); - expect(head.meta.toString()).toEqual(''); + expect(head.meta.toString()).toBe(''); expect(head.meta.toComponent).toBeDefined(); const metaComponent = head.meta.toComponent(); @@ -63,7 +63,7 @@ describe('server', () => { expect(head.link).toBeDefined(); expect(head.link.toString).toBeDefined(); - expect(head.link.toString()).toEqual(''); + expect(head.link.toString()).toBe(''); expect(head.link.toComponent).toBeDefined(); const linkComponent = head.link.toComponent(); @@ -73,7 +73,7 @@ describe('server', () => { expect(head.script).toBeDefined(); expect(head.script.toString).toBeDefined(); - expect(head.script.toString()).toEqual(''); + expect(head.script.toString()).toBe(''); expect(head.script.toComponent).toBeDefined(); const scriptComponent = head.script.toComponent(); @@ -83,7 +83,7 @@ describe('server', () => { expect(head.noscript).toBeDefined(); expect(head.noscript.toString).toBeDefined(); - expect(head.noscript.toString()).toEqual(''); + expect(head.noscript.toString()).toBe(''); expect(head.noscript.toComponent).toBeDefined(); const noscriptComponent = head.noscript.toComponent(); @@ -93,7 +93,7 @@ describe('server', () => { expect(head.style).toBeDefined(); expect(head.style.toString).toBeDefined(); - expect(head.style.toString()).toEqual(''); + expect(head.style.toString()).toBe(''); expect(head.style.toComponent).toBeDefined(); const styleComponent = head.style.toComponent(); @@ -103,7 +103,7 @@ describe('server', () => { expect(head.priority).toBeDefined(); expect(head.priority.toString).toBeDefined(); - expect(head.priority.toString()).toEqual(''); + expect(head.priority.toString()).toBe(''); expect(head.priority.toComponent).toBeDefined(); }); @@ -136,7 +136,7 @@ describe('server', () => { expect(head.meta).toBeDefined(); expect(head.meta.toString).toBeDefined(); - expect(head.meta.toString()).toEqual(''); + expect(head.meta.toString()).toBe(''); }); it('rewind() provides a fallback object for empty Helmet state', () => { @@ -147,7 +147,7 @@ describe('server', () => { expect(head.htmlAttributes).toBeDefined(); expect(head.htmlAttributes.toString).toBeDefined(); - expect(head.htmlAttributes.toString()).toEqual(''); + expect(head.htmlAttributes.toString()).toBe(''); expect(head.htmlAttributes.toComponent).toBeDefined(); expect(head.htmlAttributes.toComponent()).toEqual({}); @@ -162,7 +162,7 @@ describe('server', () => { expect(head.base).toBeDefined(); expect(head.base.toString).toBeDefined(); - expect(head.base.toString()).toEqual(''); + expect(head.base.toString()).toBe(''); expect(head.base.toComponent).toBeDefined(); const baseComponent = head.base.toComponent(); @@ -172,7 +172,7 @@ describe('server', () => { expect(head.meta).toBeDefined(); expect(head.meta.toString).toBeDefined(); - expect(head.meta.toString()).toEqual(''); + expect(head.meta.toString()).toBe(''); expect(head.meta.toComponent).toBeDefined(); const metaComponent = head.meta.toComponent(); @@ -182,7 +182,7 @@ describe('server', () => { expect(head.link).toBeDefined(); expect(head.link.toString).toBeDefined(); - expect(head.link.toString()).toEqual(''); + expect(head.link.toString()).toBe(''); expect(head.link.toComponent).toBeDefined(); const linkComponent = head.link.toComponent(); @@ -192,7 +192,7 @@ describe('server', () => { expect(head.script).toBeDefined(); expect(head.script.toString).toBeDefined(); - expect(head.script.toString()).toEqual(''); + expect(head.script.toString()).toBe(''); expect(head.script.toComponent).toBeDefined(); const scriptComponent = head.script.toComponent(); @@ -202,7 +202,7 @@ describe('server', () => { expect(head.noscript).toBeDefined(); expect(head.noscript.toString).toBeDefined(); - expect(head.noscript.toString()).toEqual(''); + expect(head.noscript.toString()).toBe(''); expect(head.noscript.toComponent).toBeDefined(); const noscriptComponent = head.noscript.toComponent(); @@ -212,7 +212,7 @@ describe('server', () => { expect(head.style).toBeDefined(); expect(head.style.toString).toBeDefined(); - expect(head.style.toString()).toEqual(''); + expect(head.style.toString()).toBe(''); expect(head.style.toComponent).toBeDefined(); const styleComponent = head.style.toComponent(); @@ -222,7 +222,7 @@ describe('server', () => { expect(head.priority).toBeDefined(); expect(head.priority.toString).toBeDefined(); - expect(head.priority.toString()).toEqual(''); + expect(head.priority.toString()).toBe(''); expect(head.priority.toComponent).toBeDefined(); }); diff --git a/__tests__/server/title.test.js b/__tests__/server/title.test.js index 7c9cc7e3..3adfb5a4 100644 --- a/__tests__/server/title.test.js +++ b/__tests__/server/title.test.js @@ -28,7 +28,7 @@ describe('server', () => { expect(head.meta).toBeDefined(); expect(head.meta.toString).toBeDefined(); - expect(head.meta.toString()).toEqual(''); + expect(head.meta.toString()).toBe(''); }); it('encodes special characters in title', () => { diff --git a/package.json b/package.json index 44474755..4a8c03af 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,8 @@ "devDependencies": { "@babel/cli": "7.17.6", "@babel/core": "7.17.9", - "@babel/eslint-parser": "7.15.0", - "@babel/eslint-plugin": "7.14.5", + "@babel/eslint-parser": "7.17.0", + "@babel/eslint-plugin": "7.17.7", "@commitlint/cli": "16.2.3", "@commitlint/config-conventional": "16.2.1", "babel-preset-kyt-react": "1.3.18", @@ -38,7 +38,7 @@ "eslint-config-kyt": "1.6.2", "eslint-config-prettier": "8.3.0", "eslint-plugin-import": "2.24.1", - "eslint-plugin-jest": "24.4.0", + "eslint-plugin-jest": "26.1.4", "eslint-plugin-jest-formatting": "3.0.0", "eslint-plugin-json": "3.1.0", "eslint-plugin-jsx-a11y": "6.4.1", @@ -49,7 +49,7 @@ "jest": "27.5.1", "jsdom": "16.4.0", "microbundle": "0.14.2", - "prettier": "2.3.2", + "prettier": "2.6.2", "raf": "3.4.1", "react": "16.14.0", "react-dom": "16.14.0", diff --git a/yarn.lock b/yarn.lock index d96c3b26..03fce0d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -66,19 +66,19 @@ json5 "^2.2.1" semver "^6.3.0" -"@babel/eslint-parser@7.15.0": - version "7.15.0" - resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.15.0.tgz#b54f06e04d0e93aebcba99f89251e3bf0ee39f21" - integrity sha512-+gSPtjSBxOZz4Uh8Ggqu7HbfpB8cT1LwW0DnVVLZEJvzXauiD0Di3zszcBkRmfGGrLdYeHUwcflG7i3tr9kQlw== +"@babel/eslint-parser@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.17.0.tgz#eabb24ad9f0afa80e5849f8240d0e5facc2d90d6" + integrity sha512-PUEJ7ZBXbRkbq3qqM/jZ2nIuakUBqCYc7Qf52Lj7dlZ6zERnqisdHioL0l4wwQZnmskMeasqUNzLBFKs3nylXA== dependencies: eslint-scope "^5.1.1" eslint-visitor-keys "^2.1.0" semver "^6.3.0" -"@babel/eslint-plugin@7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/eslint-plugin/-/eslint-plugin-7.14.5.tgz#70b76608d49094062e8da2a2614d50fec775c00f" - integrity sha512-nzt/YMnOOIRikvSn2hk9+W2omgJBy6U8TN0R+WTTmqapA+HnZTuviZaketdTE9W7/k/+E/DfZlt1ey1NSE39pg== +"@babel/eslint-plugin@7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/eslint-plugin/-/eslint-plugin-7.17.7.tgz#4ee1d5b29b79130f3bb5a933358376bcbee172b8" + integrity sha512-JATUoJJXSgwI0T8juxWYtK1JSgoLpIGUsCHIv+NMXcUDA2vIe6nvAHR9vnuJgs/P1hOFw7vPwibixzfqBBLIVw== dependencies: eslint-rule-composer "^0.3.0" @@ -1826,7 +1826,7 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/json-schema@^7.0.7": +"@types/json-schema@^7.0.9": version "7.0.11" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== @@ -1885,51 +1885,51 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/experimental-utils@^4.0.1": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz#6f2a786a4209fa2222989e9380b5331b2810f7fd" - integrity sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q== +"@typescript-eslint/scope-manager@5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.18.0.tgz#a7d7b49b973ba8cebf2a3710eefd457ef2fb5505" + integrity sha512-C0CZML6NyRDj+ZbMqh9FnPscg2PrzSaVQg3IpTmpe0NURMVBXlghGZgMYqBw07YW73i0MCqSDqv2SbywnCS8jQ== + dependencies: + "@typescript-eslint/types" "5.18.0" + "@typescript-eslint/visitor-keys" "5.18.0" + +"@typescript-eslint/types@5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.18.0.tgz#4f0425d85fdb863071680983853c59a62ce9566e" + integrity sha512-bhV1+XjM+9bHMTmXi46p1Led5NP6iqQcsOxgx7fvk6gGiV48c6IynY0apQb7693twJDsXiVzNXTflhplmaiJaw== + +"@typescript-eslint/typescript-estree@5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.18.0.tgz#6498e5ee69a32e82b6e18689e2f72e4060986474" + integrity sha512-wa+2VAhOPpZs1bVij9e5gyVu60ReMi/KuOx4LKjGx2Y3XTNUDJgQ+5f77D49pHtqef/klglf+mibuHs9TrPxdQ== + dependencies: + "@typescript-eslint/types" "5.18.0" + "@typescript-eslint/visitor-keys" "5.18.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/utils@^5.10.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.18.0.tgz#27fc84cf95c1a96def0aae31684cb43a37e76855" + integrity sha512-+hFGWUMMri7OFY26TsOlGa+zgjEy1ssEipxpLjtl4wSll8zy85x0GrUSju/FHdKfVorZPYJLkF3I4XPtnCTewA== dependencies: - "@types/json-schema" "^7.0.7" - "@typescript-eslint/scope-manager" "4.33.0" - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/typescript-estree" "4.33.0" + "@types/json-schema" "^7.0.9" + "@typescript-eslint/scope-manager" "5.18.0" + "@typescript-eslint/types" "5.18.0" + "@typescript-eslint/typescript-estree" "5.18.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/scope-manager@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3" - integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ== +"@typescript-eslint/visitor-keys@5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.18.0.tgz#c7c07709823804171d569017f3b031ced7253e60" + integrity sha512-Hf+t+dJsjAKpKSkg3EHvbtEpFFb/1CiOHnvI8bjHgOD4/wAw3gKrA0i94LrbekypiZVanJu3McWJg7rWDMzRTg== dependencies: - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/visitor-keys" "4.33.0" - -"@typescript-eslint/types@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" - integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== - -"@typescript-eslint/typescript-estree@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" - integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA== - dependencies: - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/visitor-keys" "4.33.0" - debug "^4.3.1" - globby "^11.0.3" - is-glob "^4.0.1" - semver "^7.3.5" - tsutils "^3.21.0" - -"@typescript-eslint/visitor-keys@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" - integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg== - dependencies: - "@typescript-eslint/types" "4.33.0" - eslint-visitor-keys "^2.0.0" + "@typescript-eslint/types" "5.18.0" + eslint-visitor-keys "^3.0.0" JSONStream@^1.0.4: version "1.3.5" @@ -2936,7 +2936,7 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" -debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: +debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -3378,12 +3378,12 @@ eslint-plugin-jest-formatting@3.0.0: resolved "https://registry.yarnpkg.com/eslint-plugin-jest-formatting/-/eslint-plugin-jest-formatting-3.0.0.tgz#a9f45c7d8eabfb72692ec3899998613a3e63f868" integrity sha512-XM1CHe1jX6j+t/NeppcVnm/1zgDAFqwiSLJEyLB7HDpcqBEGbbTFLSayCW2Q9y7VwcXrJbDAKRoO6vZ7jCmRFw== -eslint-plugin-jest@24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.4.0.tgz#fa4b614dbd46a98b652d830377971f097bda9262" - integrity sha512-8qnt/hgtZ94E9dA6viqfViKBfkJwFHXgJmTWlMGDgunw1XJEGqm3eiPjDsTanM3/u/3Az82nyQM9GX7PM/QGmg== +eslint-plugin-jest@26.1.4: + version "26.1.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.1.4.tgz#8e3410093ff4439d0c3a371add5bf9e05623a57a" + integrity sha512-wgqxujmqc2qpvZqMFWCh6Cniqc8lWpapvXt9j/19DmBDqeDaYhJrSRezYR1SKyemvjx+9e9kny/dgRahraHImA== dependencies: - "@typescript-eslint/experimental-utils" "^4.0.1" + "@typescript-eslint/utils" "^5.10.0" eslint-plugin-json@3.1.0: version "3.1.0" @@ -3477,6 +3477,11 @@ eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== +eslint-visitor-keys@^3.0.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" + integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== + eslint@7.32.0: version "7.32.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" @@ -3946,7 +3951,7 @@ globalyzer@0.1.0: resolved "https://registry.yarnpkg.com/globalyzer/-/globalyzer-0.1.0.tgz#cb76da79555669a1519d5a8edf093afaa0bf1465" integrity sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q== -globby@^11.0.3: +globby@^11.0.4: version "11.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== @@ -4286,7 +4291,7 @@ is-generator-fn@^2.0.0: resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== @@ -6105,10 +6110,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d" - integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ== +prettier@2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032" + integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew== pretty-bytes@^3.0.0: version "3.0.1"