From b11e6a547a1e03631b4a0ef8089de3fd531c0f2e Mon Sep 17 00:00:00 2001 From: Will Harney Date: Wed, 13 Mar 2024 14:03:37 -0400 Subject: [PATCH] remove unnecessary type assertions --- lib/__tests__/cookieJar.spec.ts | 6 +++--- lib/__tests__/cookieSorting.spec.ts | 8 ++------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/__tests__/cookieJar.spec.ts b/lib/__tests__/cookieJar.spec.ts index 474448b8..03b1648a 100644 --- a/lib/__tests__/cookieJar.spec.ts +++ b/lib/__tests__/cookieJar.spec.ts @@ -420,7 +420,7 @@ describe('CookieJar', () => { expect(allHaveRootPath).toBe(true) const noCookiesWithAnOtherKeyRetrieved = cookies.every( - (cookie) => !/^other/.test(cookie.key as string), + (cookie) => !/^other/.test(cookie.key), ) expect(noCookiesWithAnOtherKeyRetrieved).toBe(true) }) @@ -430,7 +430,7 @@ describe('CookieJar', () => { expect(cookies).toHaveLength(4) const noCookiesWithAnOtherKeyRetrieved = cookies.every( - (cookie) => !/^other/.test(cookie.key as string), + (cookie) => !/^other/.test(cookie.key), ) expect(noCookiesWithAnOtherKeyRetrieved).toBe(true) }) @@ -442,7 +442,7 @@ describe('CookieJar', () => { expect(cookies).toHaveLength(4) const noCookiesWithAnOtherKeyRetrieved = cookies.every( - (cookie) => !/^other/.test(cookie.key as string), + (cookie) => !/^other/.test(cookie.key), ) expect(noCookiesWithAnOtherKeyRetrieved).toBe(true) }) diff --git a/lib/__tests__/cookieSorting.spec.ts b/lib/__tests__/cookieSorting.spec.ts index 784457c1..b1997896 100644 --- a/lib/__tests__/cookieSorting.spec.ts +++ b/lib/__tests__/cookieSorting.spec.ts @@ -9,9 +9,7 @@ describe('Cookie sorting', () => { const cookie2 = new Cookie() expect(typeof cookie1.creationIndex).toBe('number') expect(typeof cookie2.creationIndex).toBe('number') - expect(cookie1.creationIndex).toBeLessThan( - cookie2.creationIndex as number, - ) + expect(cookie1.creationIndex).toBeLessThan(cookie2.creationIndex) }) it('should set the creation index during construction when creation time is provided', () => { @@ -21,9 +19,7 @@ describe('Cookie sorting', () => { expect(cookie1.creation).toEqual(cookie2.creation) expect(typeof cookie1.creationIndex).toBe('number') expect(typeof cookie2.creationIndex).toBe('number') - expect(cookie1.creationIndex).toBeLessThan( - cookie2.creationIndex as number, - ) + expect(cookie1.creationIndex).toBeLessThan(cookie2.creationIndex) }) it('should leave the creation index alone during setCookie', async () => {