Skip to content

Commit

Permalink
fix: fix mdx errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ooooorobo committed Nov 18, 2023
1 parent 0388846 commit c99da5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
12 changes: 8 additions & 4 deletions src/posts/60-starting-geultto-8.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ date: 2023-02-10
---









import WavyLine from "../components/WavyLine";

> 네트워크를 통해 내가 얻을 수 있는 것과 줄 수 있는 것이 무엇인지를 구분하는 것이 중요하다. <br/>
<i>우미영, \
<나를 믿고 일한다는 것>
</i>
<i>우미영, \<나를 믿고 일한다는 것></i>
최근 다양한 커뮤니티에 참여해서 네트워킹을 하고 있는데, 내가 얻을 수 있는 것은 생각해 본 적이 있지만 줄 수 있는 것을 생각해 본 적은 없었던 것 같다.

Expand Down
5 changes: 1 addition & 4 deletions src/posts/63-test-async-with-jest.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,7 @@ test("비동기 작업이 완료되기 이전에는 onBeforeExecute는 실행되
1. execute를 실행하면, 자바스크립트 콜 스택에 execute 함수가 쌓이고, 주도권이 execute 함수로 넘어갑니다.
2. 이때 `await fetchList`를 만나면, WebAPI가 setTimeout의 처리를 맡게 되고 콜 스택에서 execute는 빠져나옵니다.
3. 주도권이 테스트로 넘어옵니다.
4. <span
style = {{
color: "gray"
}}>(여기까지 동일)</span> `jest.advanceTimersByTime`으로 3.1초가 흐르고, execute는 태스크 큐로 이동해 실행 대기 상태가 됩니다.
4. <span style = {{ color: "gray" }}>(여기까지 동일)</span> `jest.advanceTimersByTime`으로 3.1초가 흐르고, execute는 태스크 큐로 이동해 실행 대기 상태가 됩니다.
5. `await flushPromises()` 처리로 인해, 테스트도 콜 스택에서 빠져나와 태스크 큐로 이동합니다.
6. 콜 스택이 비었기 때문에, 태스크 큐에서 더 앞에 있던 `execute`가 콜 스택으로 들어가 마저 실행됩니다. 이 시점에 `onAfterExecute`가 실행됩니다.
7. execute 실행이 모두 끝나면, 다시 테스트를 실행합니다. 이때는 `expect(onAfterExecute).toHaveBeenCalledTimes(1);`를 통과할 수 있습니다.
Expand Down

0 comments on commit c99da5c

Please sign in to comment.