forked from woowacourse/javascript-racingcar
-
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
[holee] typescript-racingcar #1
Open
hochan222
wants to merge
35
commits into
transcendence42:main
Choose a base branch
from
hochan222:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
view, controller λ° λ©μΈμ§ λ€λ₯Έ νμΌλ‘ λΆλ¦¬
initial page behavior racing-game base behavior racing-game exception behavior
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π μλμ°¨ κ²½μ£Ό κ²μ (typescript-racingcar)
Demo page
Subject
ꡬν μ¬ν
ꡬν μ¬ν
λλ ν 리 ꡬ쑰
μ»΄ν¬λνΈ
μ»΄ν¬λνΈ λ°©μμΌλ‘ λ¬Έμ μ μ κ·Όνμ΅λλ€. 볡μ‘ν λ¬Έμ λ₯Ό μμ λ¨μμ λ¬Έμ λ‘ λΆλ¦¬νμ¬ λ¨μν μμΌμ λ¬Έμ λ₯Ό ν΄κ²°νλκ² ν° μ₯μ μ΄λΌκ³ μκ°ν©λλ€.
cypress
λ¨Όμ μμ μ΄ μμ λλ§λ€, μλμΌλ‘ νμΈνμ§μκ³ μλμΌλ‘ κ²μ¬ν΄μ€λ€λ μ μ΄ λ무 νΈνμ΅λλ€.
BDDλ°©μμΌλ‘ κΈ°λ₯ ꡬνμ νκΈ°μ μ ν μ€νΈ μ½λλ₯Ό μμ±νλλ°, Given, When, Then μΌλ‘ μμ±νλ €κ³ νμ΅λλ€. λμμ μ€μ¬μΌλ‘ λ¨Όμ μ ν΄λκ³ μ½λλ₯Ό μμ±νκΈ° λλ¬Έμ, νλ² ν μ€νΈ μ½λλ₯Ό λ§λ€μ΄ λμΌλ©΄ μΆκ°μ μΈ μκ°μμ΄ μ ν΄μ§ λ²μ μμμ νμν κΈ°λ₯λ§ λ§λλκ² ν° μ₯μ μ΄λΌκ³ μκ°ν©λλ€. νμ§λ§... μ½μ§ μμμ΅λλ€.. μμ±νλ©΄μ μ΄λ €μμ΄ μμλλ°, cypressλ₯Ό μ¬μ©νλ©΄μ λ€μκ³Ό κ°μ μ΄λ €μμ΄ μμμ΅λλ€.
cypress λ¬Έλ²μ λͺ°λΌμ λ°λμ μ 곡μλ¬Έμλ₯Ό 보며 μ½λ μμ± μμμ‘°μ°¨ λͺ»νλλ° μ΄κ±΄ κ²½νμ΄ μμ΄λ©΄ ν΄κ²°λ λ¬Έμ λΌ μκ°ν©λλ€. κ²°κ΅ ν μ€νΈμ½λλ₯Ό λͺ°μμ μμ±νμ΅λλ€.. λ, λ무 μΈλΆμ μΌλ‘ μ κ·Όν΄μ λ°©ν₯μ±μ μμλλ°, μμΌλ‘λ
describe('racing-game base behavior'...
μ κ°μ΄ μ 체 ν° μ£Όμ λ₯Ό μ ν΄λκ³it('μλμ°¨ μ΄λ¦ μ λ ₯ νμ λ, car name input/button λΉνμ±ν'
μ κ°μ΄ ν μ€νΈ μ½λλ₯Ό μμ±νμ§ μκ³ νλλ§ μ μλ§ν λ€μ νλμ© ν μ€νΈ μ½λ μμ± ν μ€μ μ½λλ₯Ό μμ±νλ©΄ μ 체 μ£ΌκΈ°λ₯Ό μ€μΌ μ μλ€κ³ μκ°ν©λλ€. μ’μ κ²½νμ΄μμ΅λλ€.κ³ λ―Ό
HTMLInputElement | null
μ λ°νν μ μλλ°, DOM μμλ₯Ό κ°μ Έμ¬λ λ€μκ³Ό κ°μ΄ κ°μ νλ³νμ νμ΅λλ€. DOMμ μ‘°μνλ€λ³΄λ©΄ nullμ λ°νν κ²½μ°λ μκΈΈ μ μμ΄μ μνν΄λ³΄μ λλ€. if λ¬ΈμΌλ‘if(carNamesInput)
null 체ν¬λ₯Ό ν΄μ£Όλ ν¨ν΄λ μλλ° μ΄λ€ ν¨ν΄μ΄ μ’μ μΌμ΄μ€μΈμ§ κ³ λ―Όλ©λλ€.