Skip to content

Commit

Permalink
Add test for cookie custom inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
wjhsf committed Feb 2, 2024
1 parent 752784e commit ad9c887
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/__tests__/cookieUtils.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { inspect } from 'node:util'
import { Cookie } from '../cookie/cookie'

describe('Cookie utils', () => {
describe('custom inspect', () => {
it('should be a readable string', () => {
const cookie = new Cookie({
key: 'test',
value: 'b',
maxAge: 60,
})
expect(inspect(cookie)).toBe(
'Cookie="test=b; Max-Age=60; hostOnly=?; aAge=?; cAge=0ms"',
)
})
})
})

0 comments on commit ad9c887

Please sign in to comment.