Skip to content

Commit

Permalink
Update spyOn examples adding a comment for jest.restoreAllMocks call
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelYax committed Jul 8, 2022
1 parent 8247b01 commit 6fa35fe
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ Example test:
const video = require('./video');

afterEach(() => {
// restore the spy created with spyOn
jest.restoreAllMocks();
});

Expand Down Expand Up @@ -556,6 +557,7 @@ const audio = require('./audio');
const video = require('./video');

afterEach(() => {
// restore the spy created with spyOn
jest.restoreAllMocks();
});

Expand Down
2 changes: 2 additions & 0 deletions website/versioned_docs/version-25.x/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ Example test:
const video = require('./video');

afterEach(() => {
// restore the spy created with spyOn
jest.restoreAllMocks();
});

Expand Down Expand Up @@ -546,6 +547,7 @@ const audio = require('./audio');
const video = require('./video');

afterEach(() => {
// restore the spy created with spyOn
jest.restoreAllMocks();
});

Expand Down
2 changes: 2 additions & 0 deletions website/versioned_docs/version-26.x/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ Example test:
const video = require('./video');

afterEach(() => {
// restore the spy created with spyOn
jest.restoreAllMocks();
});

Expand Down Expand Up @@ -551,6 +552,7 @@ const audio = require('./audio');
const video = require('./video');

afterEach(() => {
// restore the spy created with spyOn
jest.restoreAllMocks();
});

Expand Down
2 changes: 2 additions & 0 deletions website/versioned_docs/version-27.x/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ Example test:
const video = require('./video');

afterEach(() => {
// restore the spy created with spyOn
jest.restoreAllMocks();
});

Expand Down Expand Up @@ -551,6 +552,7 @@ const audio = require('./audio');
const video = require('./video');

afterEach(() => {
// restore the spy created with spyOn
jest.restoreAllMocks();
});

Expand Down
2 changes: 2 additions & 0 deletions website/versioned_docs/version-28.0/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ Example test:
const video = require('./video');

afterEach(() => {
// restore the spy created with spyOn
jest.restoreAllMocks();
});

Expand Down Expand Up @@ -557,6 +558,7 @@ const audio = require('./audio');
const video = require('./video');

afterEach(() => {
// restore the spy created with spyOn
jest.restoreAllMocks();
});

Expand Down
2 changes: 2 additions & 0 deletions website/versioned_docs/version-28.1/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ Example test:
const video = require('./video');

afterEach(() => {
// restore the spy created with spyOn
jest.restoreAllMocks();
});

Expand Down Expand Up @@ -558,6 +559,7 @@ const audio = require('./audio');
const video = require('./video');

afterEach(() => {
// restore the spy created with spyOn
jest.restoreAllMocks();
});

Expand Down

0 comments on commit 6fa35fe

Please sign in to comment.