Testing conventions: refers to expect but uses describe
gkiely opened this issue · 0 comments
gkiely commented
In the section Testing conventions: https://www.reactnative.guide/7-testing/7.1-jest-setup.html it mentions:
"In each expect, we first mention the function name which is to be tested."
Summary
I believe this is referenced incorrectly because expect
typically accepts the function to be tested.
Expected:
- The code snippet uses
describe
,it
ortest
, andexpect
- The conventions mention
describe
andit
ortest
Actual
- The code snipped doesn't use
expect
it usesdescribe
I would've submitted a PR for this but I'm not sure of the ideal format.
Suggestion:
describe('counter', () => {
it('should increment the passed value', () => {
expect(counter(1)).toBe(2);
});
});