Skip to content

Commit

Permalink
Update javascript.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtnzlml committed Jan 10, 2019
1 parent 88afebb commit 2688317
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions javascript.md
@@ -1,6 +1,14 @@
- http://exploringjs.com/es6/
- https://developer.mozilla.org/en-US/docs/Web

# Clearing/resetting/restoring Jest mocks

I am never gonna remember this correctly I guess.

- `jest.clearAllMocks()` only clears the internal state of the mock
- `jest.resetAllMocks()` does the same + it removes any mocked implementations or return values
- `jest.restoreAllMocks()` does everything above but it restores the original non-mocked implementation (and works only with `jest.spyOn`)

# Optional chaining & nullish coalescing

- https://github.com/tc39/proposal-optional-chaining
Expand Down

0 comments on commit 2688317

Please sign in to comment.