일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- 프로그래머스
- Babel과 Webpack
- 딥다이브
- 올림픽 통계 서비스 최적화
- 진행기록
- js pattern
- 새 코드 받아오기
- 제너레이터와 async/await
- package management
- 블로그 서비스 최적화
- mixin pattern
- middleware pattern
- 모던 자바스크립트 Deep Dive
- const
- 이벤트
- 자바스크립트 딥다이브
- js pattern
- pr review
- DOM
- 이미지 갤러리 최적화
- 스코프
- 브라우저의 렌더링 과정
- version management
- unique identifiers
- 프론트엔드 성능 최적화 가이드
- 자바스크립트 패턴
- peerdependencies
- 자바스크립트
- 학습내용정리
- 커리어
- Today
- Total
목록Online Lectures (8)
Dev Blog

Accessing The DOM from Inside Tests DOM vs NodeJS Environment Accessing the DOM Specialized Libraries Should set testing environment in package.json or right in the single file as jsdom or happy-dom for emulation. Set up testing to access html page content rendered at document of virtual window. fs and path are still available because all the Node APIs available inside the test files. the Dom is..

Mocking Global Objects & Functions Mocking Frontend Features Examples Case1. fetch is a globally available function which is not imported. Thus, cannot use vi.mock to replace a module in this case. SubGlobal method allows us to replace globally available objects and functions with implementations. Then, Production codes are not effected! sendDataRequest function export async function sendDataReq..

Dealing with Side Effects Dealing with Side Effects & External Dependencies Understanding Spies & Mocks Examples Why need? In some cases, test interacts with upper system such as hard drive, database outside of program and code. Means that there could be side effects. e.g. important files or data could be deleted or edited accidentally. spy fn creates an empty function that keeps track of any fu..

More Key Testing Library APIs toBe() vs toEqual() Testing Asynchronous Code Using Setup & Cleanup Hooks toBe vs toEqual() Use "toEqual" method for deep-comparison on values not address of the object. In contrary, toBe method does shallow comparison. Testing Asynchronous Code test code here case1. callback use DoneCallback Vitest and Jest will pick up errors and consider the test to have failed a..

Combining Units Testing Units With Dependencies Balancing Unit & Integration Tests Why do? Accidentally, If an order of codes is wrong and input has wrong value, although all unit tests passed, the function including the unit functions doesn’t work as intended. Solution: Integration Test

What to & Not to Test What should & shouldn’t be tested Good tests are short & concise key points What should & shouldn’t be tested Only test your code don't test third-party code don’t test what you cannot change Example, fetch() API Don't test if it works as intended Don't test your server-side code implicitly via your client-side code Write separate tests for your backend code instead Do Test..

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-fro..