Skip to content

Commit

Permalink
remove unnecessary type assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
wjhsf committed Mar 13, 2024
1 parent 2b0bd14 commit 1b57177
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/__tests__/cookieJar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand All @@ -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)
})
Expand All @@ -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)
})
Expand Down
8 changes: 2 additions & 6 deletions lib/__tests__/cookieSorting.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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 () => {
Expand Down

0 comments on commit 1b57177

Please sign in to comment.