Skip to content

Commit a6a3856

Browse files
pkp/pkp-lib#9527 Update msw-storybook-addon, test whether works with chromatic (#319)
1 parent 209cc43 commit a6a3856

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

.storybook/preview.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,16 @@ const pinia = createPinia();
3737

3838
// Initialize MSW
3939
initialize({
40-
onUnhandledRequest: 'bypass',
41-
/** To be migrated to msw2 if neede */
42-
/*onUnhandledRequest: ({method, url}) => {
43-
if (url.pathname.includes('://mock/')) {
44-
console.error(`Unhandled ${method} request to ${url}.
40+
onUnhandledRequest: (request) => {
41+
if (request.url.includes('://mock/')) {
42+
console.error(`Unhandled ${request.method} request to ${request.url}.
4543
4644
This exception has been only logged in the console, however, it's strongly recommended to resolve this error as you don't want unmocked data in Storybook stories.
4745
4846
If you wish to mock an error response, please refer to this guide: https://mswjs.io/docs/recipes/mocking-error-responses
4947
`);
5048
}
51-
},*/
49+
},
5250
});
5351

5452
setup((app) => {

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"less": "^4.2.0",
6363
"lint-staged": "^14.0.1",
6464
"msw": "^2.0.11",
65-
"msw-storybook-addon": "^2.0.0--canary.122.b3ed3b1.0",
65+
"msw-storybook-addon": "^2.0.0-beta.1",
6666
"postcss": "^8.4.27",
6767
"prettier": "^3.0.2",
6868
"prettier-plugin-tailwindcss": "^0.5.11",

0 commit comments

Comments
 (0)