- 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:
import { createSlice } from '@reduxjs/toolkit'; | |
export const templateSlice = createSlice({ | |
name: 'name', | |
initialState: { | |
counter: 10 | |
}, | |
reducers: { | |
increment: (state, /* action */ ) => { | |
//! https://react-redux.js.org/tutorials/quick-start |
@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; |
version: '3' | |
services: | |
todosDB: | |
image: postgres:15.3 | |
container_name: todos-db | |
restart: always | |
ports: | |
- 5432:5432 | |
environment: |
Información extraída de HolisticsBlog
Table users { | |
user_id integer [pk, increment] | |
username varchar [not null, unique] | |
email varchar [not null, unique] | |
password varchar [not null] | |
name varchar [not null] | |
role varchar [not null] | |
gender varchar(10) [not null] |
Más información - Docs Oficiales
npm i -D typescript @types/node
Documentación oficial sobre Jest
npm install -D jest @types/jest ts-jest supertest