added more content to steps 2.4 and 2.5

This commit is contained in:
Ken
2019-02-26 15:04:52 -08:00
parent 5e59c8caea
commit bb62a17e57
2 changed files with 54 additions and 2 deletions

View File

@@ -57,7 +57,7 @@ describe('TestMe Component', () => {
## Mocking
Mocking functions is a large part of what makes `jest` a powerful testing library. `jest` actually intercepts module inclusion process in `node.js` allowing it to mock entire modules if needed.
Mocking functions is a large part of what makes `jest` a powerful testing library. `jest` actually intercepts module inclusion process in `node.js` allowing it to mock entire modules if needed. There are many ways to mock as you can imagine in a language as flexible as JS. We only look at the simplest case but there's a lot of depth here.
To mock a function:
@@ -78,7 +78,7 @@ Read more about jest mocking here: https://jestjs.io/docs/en/mock-functions.html
```ts
it('tests callback functions', (done) => {
someFunctionThatCallsbackWhend(done));
someFunctionThatCallsDone(done));
})
```