Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add more test
  • Loading branch information
gurgunday committed Nov 8, 2023
commit c761c84966a90166b7059c3d868f2597f354c68d
7 changes: 5 additions & 2 deletions test/cookie.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,16 @@ test('should set multiple cookies', (t) => {
})

test('should set multiple cookies', (t) => {
t.plan(11)
t.plan(12)
const fastify = Fastify()
fastify.register(plugin)

fastify.get('/', (req, reply) => {
reply
.setCookie('foo', 'foo')
.cookie('bar', 'test')
.cookie('bar', 'test', {
partitioned: true
})
.setCookie('wee', 'woo', {
partitioned: true,
secure: true
Expand All @@ -125,6 +127,7 @@ test('should set multiple cookies', (t) => {
t.equal(cookies[2].name, 'wee')
t.equal(cookies[2].value, 'woo')

t.equal(res.headers['set-cookie'][1], 'bar=test; Partitioned')
t.equal(res.headers['set-cookie'][2], 'wee=woo; Secure; Partitioned')
})
})
Expand Down