chore: adding user creation tests

This commit is contained in:
canove
2020-10-23 13:12:00 -03:00
parent 3302cd643a
commit 4d01cc3379
54 changed files with 459 additions and 366 deletions

View File

@@ -32,13 +32,10 @@ const CreateUserService = async ({
"Check-email",
"An user with this email already exists.",
async value => {
if (value) {
const emailExists = await User.findOne({
where: { email: value }
});
return !emailExists;
}
return false;
const emailExists = await User.findOne({
where: { email: value! }
});
return !emailExists;
}
),
password: Yup.string().required().min(5)