Skip to content

Commit

Permalink
test: add request cookies tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito committed Jul 19, 2024
1 parent 487ea22 commit 5774b63
Show file tree
Hide file tree
Showing 8 changed files with 216 additions and 191 deletions.
29 changes: 0 additions & 29 deletions test/browser/rest-api/cookies-http-only.mocks.ts

This file was deleted.

17 changes: 0 additions & 17 deletions test/browser/rest-api/cookies-http-only.test.ts

This file was deleted.

27 changes: 0 additions & 27 deletions test/browser/rest-api/cookies-inheritance.mocks.ts

This file was deleted.

21 changes: 0 additions & 21 deletions test/browser/rest-api/cookies-inheritance.test.ts

This file was deleted.

12 changes: 0 additions & 12 deletions test/browser/rest-api/cookies-request.mocks.ts

This file was deleted.

85 changes: 0 additions & 85 deletions test/browser/rest-api/cookies-request.test.ts

This file was deleted.

17 changes: 17 additions & 0 deletions test/browser/rest-api/request/request-cookies.mocks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { http, HttpResponse } from 'msw'
import { setupWorker } from 'msw/browser'

const worker = setupWorker(
http.get('*/cookies', ({ cookies }) => {
return HttpResponse.json(cookies)
}),
http.post('/set-cookies', async ({ request }) => {
return new HttpResponse(null, {
headers: {
'Set-Cookie': await request.clone().text(),
},
})
}),
)

worker.start()
Loading

0 comments on commit 5774b63

Please sign in to comment.