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 additionalTestBlockFunctions to take a regex #993

Open
NickBolles opened this issue Dec 2, 2021 · 1 comment
Open

Comments

@NickBolles
Copy link

I would like to do something like this

  "jest/expect-expect": [
    "error",
    {
        assertFunctionNames: ['expect', 'expect*', 'assert*'],
        additionalTestBlockFunctions: ['expect*', 'assert*']
    }
  ]

So that I can modularize assertion functions but still get the expect-expect checking on it. Seems like this would be easy to do by duplicating what assertionFunctionNames is doing

matchesAssertFunctionName

https://github.com/jest-community/eslint-plugin-jest/blob/main/src/rules/expect-expect.ts#L25

and using it here:

https://github.com/jest-community/eslint-plugin-jest/blob/main/src/rules/expect-expect.ts#L118

@NickBolles
Copy link
Author

PR for (starting) to implement this: #994

@G-Rath G-Rath changed the title Allow additionalTestBlockFunctions to take a regex [expect-expect] allow additionalTestBlockFunctions to take a regex Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants