- 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:
| var script = document.createElement('script'); | |
| script.src = "https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.js"; | |
| script.onload = initSocket; // Calls initSocket after the library is loaded | |
| document.head.appendChild(script); | |
| function initSocket() { | |
| // Replace 'backend-url:port' with your actual backend URL and port | |
| var socket = io('http://backend-url:port'); | |
| socket.on('connect', function() { |
| 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 |
| " plugins | |
| let need_to_install_plugins = 0 | |
| if empty(glob('~/.vim/autoload/plug.vim')) | |
| silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs | |
| \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
| "autocmd VimEnter * PlugInstall --sync | source $MYVIMRC | |
| let need_to_install_plugins = 1 | |
| endif | |
| call plug#begin() |