- Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
- Opcional: Si usamos Fetch API en el proyecto:
function parseJwt (token) { | |
var base64Url = token.split('.')[1]; | |
var base64 = base64Url.replace('-', '+').replace('_', '/'); | |
return JSON.parse(window.atob(base64)); | |
}; |
@IsString() | |
@MinLength(6) | |
@MaxLength(50) | |
@Matches( | |
/(?:(?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/, { | |
message: 'The password must have a Uppercase, lowercase letter and a number' | |
}) | |
password: string; |