Nomad Kim 2023. 3. 28. 05:42

Understanding Unit Testing Fundamentals

  • Creating Unit Tests
  • AAA - Arrange, Act, Asset

AAA - Arrange, Act, Assert

  • A - Arrange, Define the testing environment & values
  • A - Act, Run the actual code / function that should be tested
  • A - Assert, Evaluate the produced value / result and compare it to the expected value / result

Writing Good Tests Is An Iterative Process!

Test examples(basic-testing-frontend)

 

 

 

 

 

 

 

Vitest ์‚ฌ์šฉ์ด์œ 

Jest ์˜ ๊ฒฝ์šฐ, ES-Module ์„ experimental support ํ•˜๋ฏ€๋กœ,

์ด๋ฅผ ์œ„ํ•œ ์„ค์ •์ด ํ•„์š”ํ•˜๋‹ค. ๋‹จ์ง€ ํ…Œ์ŠคํŠธ๋ฅผ ์œ„ํ•ด ์ด ๊ฐ™์€ ์„ค์ •์„ ํ•˜๋Š” ๊ฒƒ์€ ๋ฐ”๋žŒ์งํ•˜์ง€ ์•Š์„ ์ˆ˜ ์žˆ๋‹ค.

 

๋”ฐ๋ผ์„œ, ES Module ์„ ์ง€์›ํ•˜๊ณ , Jest API ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” Vitest ๋กœ ๊ฒฐ์ •.