Skip to content

Instantly share code, notes, and snippets.

View Syden10's full-sized avatar

Nico Vazquez Syden10

View GitHub Profile
@Syden10
Syden10 / templateSlice.js
Created July 23, 2024 14:58
Redux toolkit slice template
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
@Syden10
Syden10 / [React + Vite]: Jest + React Testing Library setup.md
Last active July 18, 2024 14:25
[React + Vite]: Jest + React Testing Library setup

Jest + React Testing Library installation and setup

For React + Vite projects

  1. Dependencies without TypeScript:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react 
yarn add --dev @testing-library/react @testing-library/dom @types/jest jest-environment-jsdom

With TypeScript (optional):

@Syden10
Syden10 / vite-testing-config.md
Created June 23, 2024 18:38 — forked from Klerith/vite-testing-config.md
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: