Skip to content

Commit d8cf93d

Browse files
committed
update msw to fix the error body type issue
1 parent 5b43701 commit d8cf93d

File tree

11 files changed

+66
-27
lines changed

11 files changed

+66
-27
lines changed

exercises/03.best-practices/03.solution.network-mocking/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@types/react-dom": "^19.0.3",
1717
"@vitejs/plugin-react": "^4.3.4",
1818
"@vitest/browser": "^3.0.5",
19-
"msw": "^2.7.0",
19+
"msw": "^2.7.2",
2020
"playwright": "^1.49.1",
2121
"tailwindcss": "^4.0.7",
2222
"vite": "^6.0.7",

exercises/03.best-practices/03.solution.network-mocking/src/discount-code-form.browser.test.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,12 @@ test('displays an error when fetching the discount fails', async ({
5858
worker,
5959
}) => {
6060
worker.use(
61-
http.post('https://api.example.com/discount/code', () => {
62-
return new HttpResponse(null, { status: 500 })
63-
}),
61+
http.post<never, string, Discount>(
62+
'https://api.example.com/discount/code',
63+
() => {
64+
return new HttpResponse(null, { status: 500 })
65+
},
66+
),
6467
)
6568

6669
render(<DiscountCodeForm />)

exercises/03.best-practices/04.problem.element-presence/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@types/react-dom": "^19.0.3",
1717
"@vitejs/plugin-react": "^4.3.4",
1818
"@vitest/browser": "^3.0.5",
19-
"msw": "^2.7.0",
19+
"msw": "^2.7.2",
2020
"playwright": "^1.49.1",
2121
"tailwindcss": "^4.0.7",
2222
"vite": "^6.0.7",

exercises/03.best-practices/04.problem.element-presence/src/discount-code-form.browser.test.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,12 @@ test('displays an error when fetching the discount fails', async ({
5858
worker,
5959
}) => {
6060
worker.use(
61-
http.post('https://api.example.com/discount/code', () => {
62-
return new HttpResponse(null, { status: 500 })
63-
}),
61+
http.post<never, string, Discount>(
62+
'https://api.example.com/discount/code',
63+
() => {
64+
return new HttpResponse(null, { status: 500 })
65+
},
66+
),
6467
)
6568

6669
render(<DiscountCodeForm />)

exercises/03.best-practices/04.solution.element-presence/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@types/react-dom": "^19.0.3",
1717
"@vitejs/plugin-react": "^4.3.4",
1818
"@vitest/browser": "^3.0.5",
19-
"msw": "^2.7.0",
19+
"msw": "^2.7.2",
2020
"playwright": "^1.49.1",
2121
"tailwindcss": "^4.0.7",
2222
"vite": "^6.0.7",

exercises/03.best-practices/04.solution.element-presence/src/discount-code-form.browser.test.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,12 @@ test('displays an error when fetching the discount fails', async ({
5858
worker,
5959
}) => {
6060
worker.use(
61-
http.post('https://api.example.com/discount/code', () => {
62-
return new HttpResponse(null, { status: 500 })
63-
}),
61+
http.post<never, string, Discount>(
62+
'https://api.example.com/discount/code',
63+
() => {
64+
return new HttpResponse(null, { status: 500 })
65+
},
66+
),
6467
)
6568

6669
render(<DiscountCodeForm />)

exercises/03.best-practices/05.problem.page-navigation/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@types/react-dom": "^19.0.3",
1717
"@vitejs/plugin-react": "^4.3.4",
1818
"@vitest/browser": "^3.0.5",
19-
"msw": "^2.7.0",
19+
"msw": "^2.7.2",
2020
"playwright": "^1.49.1",
2121
"tailwindcss": "^4.0.7",
2222
"vite": "^6.0.7",

exercises/03.best-practices/05.problem.page-navigation/src/discount-code-form.browser.test.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,12 @@ test('displays an error when fetching the discount fails', async ({
6868
worker,
6969
}) => {
7070
worker.use(
71-
http.post('https://api.example.com/discount/code', () => {
72-
return new HttpResponse(null, { status: 500 })
73-
}),
71+
http.post<never, string, Discount>(
72+
'https://api.example.com/discount/code',
73+
() => {
74+
return new HttpResponse(null, { status: 500 })
75+
},
76+
),
7477
)
7578

7679
// 🐨 Provide the `wrapper` for this render.

exercises/03.best-practices/05.solution.page-navigation/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@types/react-dom": "^19.0.3",
1717
"@vitejs/plugin-react": "^4.3.4",
1818
"@vitest/browser": "^3.0.5",
19-
"msw": "^2.7.0",
19+
"msw": "^2.7.2",
2020
"playwright": "^1.49.1",
2121
"react-router": "^7.1.3",
2222
"tailwindcss": "^4.0.7",

exercises/03.best-practices/05.solution.page-navigation/src/discount-code-form.browser.test.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,12 @@ test('displays an error when fetching the discount fails', async ({
6565
worker,
6666
}) => {
6767
worker.use(
68-
http.post('https://api.example.com/discount/code', () => {
69-
return new HttpResponse(null, { status: 500 })
70-
}),
68+
http.post<never, string, Discount>(
69+
'https://api.example.com/discount/code',
70+
() => {
71+
return new HttpResponse(null, { status: 500 })
72+
},
73+
),
7174
)
7275

7376
render(<DiscountCodeForm />, { wrapper })

0 commit comments

Comments
 (0)