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

[expect-expect] Allow for expect statements in helper functions #1237

Closed
OmarJaroudi opened this issue Sep 7, 2022 · 2 comments
Closed

[expect-expect] Allow for expect statements in helper functions #1237

OmarJaroudi opened this issue Sep 7, 2022 · 2 comments

Comments

@OmarJaroudi
Copy link

OmarJaroudi commented Sep 7, 2022

The following scenario:

test() {
   func();
}

...

func() {
   expect(etc)
}

triggers a jest/expect-expect warning. Is there a way to avoid this since we are actually calling an expect statement even though its in a helper function...?
PS it probably isnt practical to specify the function name in the assertFunctionNames as each test file might probably have local functions...

@G-Rath
Copy link
Collaborator

G-Rath commented Sep 9, 2022

Duplicate of #993

@G-Rath G-Rath marked this as a duplicate of #993 Sep 9, 2022
@G-Rath G-Rath closed this as not planned Won't fix, can't repro, duplicate, stale Sep 9, 2022
@G-Rath G-Rath reopened this Sep 9, 2022
@G-Rath
Copy link
Collaborator

G-Rath commented Sep 9, 2022

Oh actually no sorry this isn't a duplicate, but as you've said assertFunctionNames is the way to go with this. You can use overrides to allow functions only for specific tests.

@G-Rath G-Rath closed this as completed Sep 9, 2022
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

2 participants