Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing conventions: refers to expect but uses describe #43

Open
gkiely opened this issue Jun 28, 2021 · 0 comments
Open

Testing conventions: refers to expect but uses describe #43

gkiely opened this issue Jun 28, 2021 · 0 comments

Comments

@gkiely
Copy link

gkiely commented Jun 28, 2021

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 or test, and expect
  • The conventions mention describe and it or test

Actual

  • The code snipped doesn't use expect it uses describe

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);
  });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant