Skip to content

Instantly share code, notes, and snippets.

View SebastianCB-dev's full-sized avatar
💙
Chelsea F.C.

SebastianCB SebastianCB-dev

💙
Chelsea F.C.
View GitHub Profile
@SebastianCB-dev
SebastianCB-dev / React-Test-Gist.md
Last active November 3, 2023 01:22
This is a Gist to configure testing in React + Vite

Step to install testing libraries in React JS.

This has to be used in project with React + Vite

  1. Installation
pnpm install vitest happy-dom @testing-library/react @testing-library/user-event --save-dev
@Klerith
Klerith / vite-testing-config.md
Last active May 5, 2024 23:51
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:
@Klerith
Klerith / react-index.html
Created May 6, 2020 19:07
Introducción a React
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<!-- Cargat React -->
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
@yarinV
yarinV / script.js
Last active May 3, 2024 16:38
JAVASCRIPT: JAVASCRIPT: JAVASCRIPT: getBrowserType
function getBrowserType(){
if( navigator.userAgent.indexOf('MSIE 7') > -1 ){
return BrowserString("MSIE 7");
}
if( navigator.userAgent.indexOf('MSIE 8') > -1 ){
return BrowserString("MSIE 8");
}
if( navigator.userAgent.indexOf('MSIE 9') > -1 ){
return BrowserString("MSIE 9");