Skip to content

Instantly share code, notes, and snippets.

View AbrahamVasquez's full-sized avatar
🏠
Working from home

Abraham Vasquez AbrahamVasquez

🏠
Working from home
View GitHub Profile
@Klerith
Klerith / templateSlice.js
Last active July 15, 2024 17:09
Cascaron para crear Redux Slices rápidamente
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
@Klerith
Klerith / vite-testing-config.md
Last active July 22, 2024 19:01
Vite + Jest + React Testing Library - Configuraciones a seguir

Instalación y configuracion de Jest + React Testing Library

En proyectos de React + Vite

  1. Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react 
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
  1. Opcional: Si usamos Fetch API en el proyecto:

Tarea

  1. Crear un nuevo componente dentro de la carpeta SRC llamado CounterApp

  2. El CounterApp debe de ser un Functional Component

  3. El contenido del CounterApp debe de ser:

CounterApp