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

Calculator 과제 제출합니다 #3

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

cos18
Copy link

@cos18 cos18 commented Jun 27, 2021

No description provided.

@cos18 cos18 self-assigned this Jun 27, 2021
@hyo-choi hyo-choi requested a review from kmin-283 June 28, 2021 05:25
Comment on lines +1 to +23
{
"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"
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eslint 설정을 자세하게 하는 법을 저도 배워야겠네요 👍

Comment on lines +5 to +15
.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);
})

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');
});
});
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

꼼꼼한테스트 저도 본받아야겠습니다.

Comment on lines +1 to +8
{
"compilerOptions": {
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress"]
},
"include": ["**/*.ts"]
}

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);
Copy link

@kmin-283 kmin-283 Jun 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

operateResult에서 prevVal, currVal의 기본값으로 0을 받도록 하면 더 깔끔해질 것 같습니다!

@kmin-283 kmin-283 self-requested a review June 28, 2021 05:56
Copy link

@kmin-283 kmin-283 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제가 환경 세팅하는 부분이 많이 부족한데 도움이 많이 됐습니다. 그리고 코드 읽기가 쉬워서 좋았습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants