Skip to content

Commit

Permalink
Unify noop and test renderer assertion APIs (#14952)
Browse files Browse the repository at this point in the history
* Throw in tests if work is done before emptying log

Test renderer already does this. Makes it harder to miss unexpected
behavior by forcing you to assert on every logged value.

* Convert ReactNoop tests to use jest matchers

The matchers warn if work is flushed while the log is empty. This is
the pattern we already follow for test renderer. I've used the same APIs
as test renderer, so it should be easy to switch between the two.
  • Loading branch information
acdlite authored Feb 26, 2019
1 parent bc350da commit 474ba05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/__tests__/ReactTestRenderer-test.internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ describe('ReactTestRenderer', () => {
</Context.Provider>
);
ReactNoop.render(<App />);
ReactNoop.flush();
expect(ReactNoop).toFlushWithoutYielding();
ReactTestRenderer.create(<App />);
});

Expand Down

0 comments on commit 474ba05

Please sign in to comment.