feat(reaclette): Computed tests continuation#33
Merged
julien-f merged 6 commits intoJsCommunity:nextfrom Mar 14, 2019
Merged
Conversation
julien-f
reviewed
Mar 13, 2019
julien-f
reviewed
Mar 14, 2019
src/new.spec.js
Outdated
| effects: { | ||
| changeState() { | ||
| this.state.corge = 8; | ||
| }, |
Collaborator
There was a problem hiding this comment.
Why not use the _setState effects provided for the tests?
julien-f
reviewed
Mar 14, 2019
src/new.spec.js
Outdated
| }); | ||
|
|
||
| it("are not called when its state/props dependencies do not change", async () => { | ||
| const baz = jest.fn(({ qux }, { bar }) => bar * qux); |
Collaborator
There was a problem hiding this comment.
I think we should call it sum and it's dependencies a and b (or i/j or n/m), it will make the test either to read/understand.
julien-f
reviewed
Mar 14, 2019
| await effects.changeState(); | ||
| expect(getState().baz).toBe(11); | ||
| expect(baz.mock.calls.length).toBe(2); | ||
| }); |
Collaborator
There was a problem hiding this comment.
This test should be almost exactly the same than the previous one except that we are changing:
- its state dependency
- its props dependency
julien-f
approved these changes
Mar 14, 2019
julien-f
pushed a commit
that referenced
this pull request
Mar 21, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.