We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
starting jest27, instead of jest-in-case, test.each can be used because it doesn't require any extra library
jest-in-case
test.each
The text was updated successfully, but these errors were encountered:
Here's an example of repetitive Jest test cases with test.each.
import {isPasswordAllowed} from '../auth' describe('isPasswordAllowed', () => { const validPasswords = [['valid password', '!aBc1234']] const invalidPasswords = [ ['too short', 'a2c!'], ['no letters', '123456!'], ['no numbers', 'ABCdef!'], ['no uppercase letters', 'abc123!'], ['no lowercase letters', 'ABC123!'], ['no non-alphanumeric characters', 'ABCdef123'], ] test.each(validPasswords)('%p - %p', (firstArgs, secondArgs) => { expect(isPasswordAllowed(secondArgs)).toBe(true) }) test.each(invalidPasswords)('%p - %p', (firstArgs, secondArgs) => { expect(isPasswordAllowed(secondArgs)).toBe(false) }) })
Sorry, something went wrong.
No branches or pull requests
starting jest27, instead of
jest-in-case
,test.each
can be used because it doesn't require any extra libraryThe text was updated successfully, but these errors were encountered: