Skip to content

Commit

Permalink
refactor: (#92) jest 테스트 시 필요한 env 설정 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
inyeong-kang committed Jul 27, 2023
1 parent 0866d57 commit 46fa718
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions frontend/jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import 'whatwg-fetch';

import dotenv from 'dotenv';
import { setupServer } from 'msw/node';

import { handlers } from './src/mocks/handlers';

dotenv.config({ path: './.env.test' });

export const server = setupServer(...handlers);

beforeAll(() => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"lint": "eslint --cache .",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"test": "DOTENV_CONFIG_PATH=.env.test jest --setupFiles=dotenv/config jest --setupFiles=dotenv/config",
"test": "jest",
"prepare": "cd .. && husky install frontend/.husky"
},
"dependencies": {
Expand Down

0 comments on commit 46fa718

Please sign in to comment.