diff options
| author | zyoshoka <107108195+zyoshoka@users.noreply.github.com> | 2024-02-08 13:28:49 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-08 13:28:49 +0900 |
| commit | 5299d17060d72f1a81edffccedff2f1c78a9c520 (patch) | |
| tree | 68ab9fc17a2c0336d06459d75a7625570c55712c /CONTRIBUTING.md | |
| parent | Fix: Summaly proxy利用時にプレイヤーが動作しないことがあ... (diff) | |
| download | sharkey-5299d17060d72f1a81edffccedff2f1c78a9c520.tar.gz sharkey-5299d17060d72f1a81edffccedff2f1c78a9c520.tar.bz2 sharkey-5299d17060d72f1a81edffccedff2f1c78a9c520.zip | |
test(frontend): migrate MSW in Storybook to v2 (#13195)
Diffstat (limited to 'CONTRIBUTING.md')
| -rw-r--r-- | CONTRIBUTING.md | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7f6c1f4f82..ac0a1ba3c1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -286,18 +286,17 @@ export const argTypes = { min: 1, max: 4, }, + }, }; ``` Also, you can use msw to mock API requests in the storybook. Creating a `MyComponent.stories.msw.ts` file to define the mock handlers. ```ts -import { rest } from 'msw'; +import { HttpResponse, http } from 'msw'; export const handlers = [ - rest.post('/api/notes/timeline', (req, res, ctx) => { - return res( - ctx.json([]), - ); + http.post('/api/notes/timeline', ({ request }) => { + return HttpResponse.json([]); }), ]; ``` |