Skip to content

Commit

Permalink
feat: Add MSW addon config
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Andrade <arthurfelandrade@gmail.com>
  • Loading branch information
ArthurTriis1 committed Jul 11, 2022
1 parent 0c5c5a8 commit d24f8e6
Show file tree
Hide file tree
Showing 6 changed files with 565 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ src/typings/

# gatsby files
.cache/
public
public/*
!public
!public/mockServiceWorker.js

# Mac files
.DS_Store
Expand Down
8 changes: 8 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ import '!style-loader!css-loader!sass-loader!../src/styles/global/resets.scss'
import '!style-loader!css-loader!sass-loader!../src/styles/global/storybook-components.scss'
import '!style-loader!css-loader!sass-loader!../src/styles/global/tokens.scss'
import '!style-loader!css-loader!sass-loader!../src/styles/global/typography.scss'
import { initialize, mswDecorator } from 'msw-storybook-addon'

// Initialize MSW
initialize()

import SBTheme from './theme'

// Provide the MSW addon decorator globally
export const decorators = [mswDecorator]

// Viewports from src/styles/vendors/include-media_overwrite.scss
const customViewports = {
phone: {
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
"husky": "^5.2.0",
"is-ci": "^3.0.0",
"lint-staged": "^10.5.4",
"msw": "^0.43.1",
"msw-storybook-addon": "^1.6.3",
"postcss": "^8.4.4",
"prettier": "^2.2.0",
"storybook-addon-gatsby": "^0.0.5",
Expand Down Expand Up @@ -113,5 +115,8 @@
"*.scss": [
"stylelint --fix"
]
},
"msw": {
"workerDirectory": "public"
}
}
Loading

0 comments on commit d24f8e6

Please sign in to comment.