-
Notifications
You must be signed in to change notification settings - Fork 4
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
Calculator 과제 제출합니다 #3
base: main
Are you sure you want to change the base?
Conversation
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true, | ||
"cypress/globals": true | ||
}, | ||
"extends": [ | ||
"airbnb-base", | ||
"plugin:cypress/recommended" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 12, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"cypress" | ||
], | ||
"rules": { | ||
"no-console": "off" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eslint 설정을 자세하게 하는 법을 저도 배워야겠네요 👍
.reduce<Cypress.Chainable<JQuery<HTMLElement>>>( | ||
(cyObj: Cypress.Chainable<JQuery<HTMLElement>>, f: string) => ( | ||
cyObj | ||
.get(/\d/.test(f) ? '.digit' : '.operation') | ||
.contains(f) | ||
.click() | ||
), | ||
cy) | ||
.get('#total').should((elem) => { | ||
expect(elem.text()).to.equal(result); | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분에서 저도 테스트 코드 작성하는 방법 배워갑니다!
그런데 click하는 부분이랑 검증하는 부분이랑 나눠져있었다면 어땠을까요?
expect(elem.text()).to.equal('0'); | ||
}); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
꼼꼼한테스트 저도 본받아야겠습니다.
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"lib": ["es5", "dom"], | ||
"types": ["cypress"] | ||
}, | ||
"include": ["**/*.ts"] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cypress에서도 tsconfig 파일이 필요했군요...! 알아갑니다 👍
|
||
function onOperationClicked(e: Event) { | ||
if (currVal !== undefined) { | ||
prevVal = operateResult(prevVal ?? 0, currVal ?? 0, op); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
operateResult에서 prevVal, currVal의 기본값으로 0을 받도록 하면 더 깔끔해질 것 같습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제가 환경 세팅하는 부분이 많이 부족한데 도움이 많이 됐습니다. 그리고 코드 읽기가 쉬워서 좋았습니다.
No description provided.