Skip to content

Instantly share code, notes, and snippets.

@giovanigenerali
Last active August 2, 2019 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giovanigenerali/b458d2f7475ee073611c198f1c3281a8 to your computer and use it in GitHub Desktop.
Save giovanigenerali/b458d2f7475ee073611c198f1c3281a8 to your computer and use it in GitHub Desktop.
Yup test()
const validationSchema = Yup.object({
email: Yup
.string()
.trim()
.email('Informe um e-mail válido')
.required('Informe seu e-mail'),
password: Yup
.string()
.min(6, 'A senha deve conter no mínimo 6 caracteres')
.required('Informe sua senha'),
.test({
name: 'password-strength',
test: value => value !== '123456',
message: 'A sua senha é fraca',
}),
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment