Skip to content

Commit

Permalink
docs(wiki): correctly call checkTimes in afterEach hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
diego-aquino committed Jan 8, 2025
1 parent 7dc615e commit 70503e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ beforeEach(() => {
afterEach(() => {
// 4.3. Check that all expected requests were made
// https://bit.ly/zimic-interceptor-http#http-interceptorchecktimes
myInterceptor.clear();
myInterceptor.checkTimes();
});

afterAll(async () => {
Expand Down
8 changes: 7 additions & 1 deletion docs/wiki/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,18 @@ beforeAll(async () => {
await myInterceptor.start();
});

afterEach(() => {
beforeEach(() => {
// 4.2. Clear interceptors so that no tests affect each other
// https://bit.ly/zimic-interceptor-http#http-interceptorclear
myInterceptor.clear();
});

afterEach(() => {
// 4.3. Check that all expected requests were made
// https://bit.ly/zimic-interceptor-http#http-interceptorchecktimes
myInterceptor.checkTimes();
});

afterAll(async () => {
// 4.3. Stop intercepting requests
// https://bit.ly/zimic-interceptor-http#http-interceptorstop
Expand Down

0 comments on commit 70503e6

Please sign in to comment.