Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

충남대 FE_강병현 5주차 과제 Step1 #93

Open
wants to merge 7 commits into
base: kang-kibong
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": ["react-app", "eslint:recommended", "plugin:import/typescript", "airbnb", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"no-var": "error",
"no-multiple-empty-lines": "error",
"no-console": ["error", { "allow": ["warn", "error", "info"] }],
"eqeqeq": "error",
"dot-notation": "error",
"import/extensions": ["error", "ignorePackages", {
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}],
"react/jsx-props-no-spreading": "off",
"import/prefer-default-export": "off",
"react/jsx-filename-extension": ["error", { "extensions": [".tsx"] }],
"import/no-extraneous-dependencies": "off",
"import/no-unresolved": "off",
"react/require-default-props": "off",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error", { "variables": false , "functions": false,"classes": false}],
"react/prop-types": "off",
"import/no-cycle": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"jsx-a11y/label-has-associated-control": [ 2, {
"some": [ "nesting", "id" ]
}],
"react-hooks/exhaustive-deps": "off",
"no-alert": "off",
"react/jsx-no-useless-fragment": "off"
},
"settings": {
"import/resolver": {
"alias": {
"map": [
["@", "./src"],
["@components", "./src/components"],
["@assets", "./src/assets"],
["@hooks", "./src/hooks"],
["@pages", "./src/pages"],
["@routes", "./src/routes"],
["@utils", "./src/utils"],
["@context", "./src/context"],
["@internalTypes", "./src/types"],
["@apis", "./src/apis"],
["@mocks", "./src/mocks"]
],
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
}
}
59 changes: 0 additions & 59 deletions .eslintrc.js

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand All @@ -22,4 +23,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

.eslintcache
.yaml

*storybook.log
3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

5 changes: 3 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"singleQuote": true,
"parser": "typescript",
"semi": true,
"useTabs": false,
"tabWidth": 2,
"trailingComma": "all",
"printWidth": 100,
"printWidth": 120,
"arrowParens": "always"
}
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# 카카오 테크 캠퍼스 - 프론트엔드 카카오 선물하기 편
# 5️⃣ 5주차 로그인 및 관심목록 (with. 테스트코드)
## 🎯 1단계 - Form 부분 테스트 코드 작성하기
### ✅ 기능 목록
- [x] MSW를 사용하여 Mock API가 동작하도록 구현
- [x] 상품 상세 API 동작
- [x] 상품 옵션 API 동작
- [x] 단위 테스트 진행
- [x] 상품 상세페이지 통합 테스트 구현
- [x] 결제 페이지의 Form관련한 통합 테스트 코드 구현
- [x] 현금영수증 Checkbox가 false인 경우 현금영수증 종류, 현금영수증 번호 field가 비활성화 되어있는지 확인하는 테스트 코드 구현 (만약 true인 경우 현금영수증 종류, 번호 field에 값이 입력 되어야 함)
- [x] form의 validation 로직이 정상 동작하는지 확인하는 테스트 코드 구현
30 changes: 29 additions & 1 deletion craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,35 @@ const path = require('path');
module.exports = {
webpack: {
alias: {
'@': path.resolve(__dirname, 'src'),
'@': path.resolve(__dirname, 'src/'),
'@components': path.resolve(__dirname, 'src/components'),
'@assets': path.resolve(__dirname, 'src/assets'),
'@hooks': path.resolve(__dirname, 'src/hooks'),
'@pages': path.resolve(__dirname, 'src/pages'),
'@routes': path.resolve(__dirname, 'src/routes'),
'@utils': path.resolve(__dirname, 'src/utils'),
'@context': path.resolve(__dirname, 'src/context'),
'@mocks': path.resolve(__dirname, 'src/mocks'),
'@internalTypes': path.resolve(__dirname, 'src/types'),
'@apis': path.resolve(__dirname, 'src/apis'),
},
},
jest: {
configure: {
moduleNameMapper: {
'^axios$': 'axios/dist/node/axios.cjs',
'^@/(.*)$': '<rootDir>/src/$1',
'^@apis/(.*)$': '<rootDir>/src/apis/$1',
'^@assets/(.*)$': '<rootDir>/src/assets/$1',
'^@components/(.*)$': '<rootDir>/src/components/$1',
'^@context/(.*)$': '<rootDir>/src/context/$1',
'^@mocks/(.*)$': '<rootDir>/src/mocks/$1',
'^@pages/(.*)$': '<rootDir>/src/pages/$1',
'^@routes/(.*)$': '<rootDir>/src/routes/$1',
'^@types/(.*)$': '<rootDir>/src/types/$1',
'^@utils/(.*)$': '<rootDir>/src/utils/$1',
'^@hooks/(.*)$': '<rootDir>/src/hooks/$1',
},
},
},
};
Loading