Skip to content

Commit

Permalink
chore: update MSW to v2.6.8
Browse files Browse the repository at this point in the history
  • Loading branch information
jellydn committed Dec 9, 2024
1 parent 4aa287e commit 42f8adf
Show file tree
Hide file tree
Showing 6 changed files with 255 additions and 255 deletions.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion mocks/browser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { setupWorker } from 'msw';
import { setupWorker } from 'msw/browser';

import handlers from './handlers';

Expand Down
6 changes: 3 additions & 3 deletions mocks/handlers.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { rest } from 'msw';
import { http } from 'msw';

const handlers = [
rest.post('/login', async (_req, res, ctx) => {
http.post('/login', async (_req, res, ctx) => {
// Persist user's authentication in the session
sessionStorage.setItem('is-authenticated', 'true');
return res(
// Respond with a 200 status code
ctx.status(200),
);
}),
rest.get('/user', async (_req, res, ctx) => {
http.get('/user', async (_req, res, ctx) => {
// Check if the user is authenticated in this session
const isAuthenticated = sessionStorage.getItem('is-authenticated');
if (!isAuthenticated) {
Expand Down
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
/// <reference types="next/navigation-types/compat/navigation" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"identity-obj-proxy": "3.0.0",
"jest-fetch-mock": "3.0.3",
"jsdom": "25.0.1",
"msw": "1.3.5",
"msw": "2.6.8",
"postcss": "8.4.49",
"prisma": "6.0.1",
"rustywind": "0.23.1",
Expand Down
Loading

0 comments on commit 42f8adf

Please sign in to comment.