-
-
Save kbitsr/2e7bcc9e1b6a971f5f2a7be6e0aa2129 to your computer and use it in GitHub Desktop.
Revisions
-
kbitsr revised this gist
Oct 11, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -39,7 +39,7 @@ module.exports = { } ``` __jest.setup.js__ ``` // En caso de necesitar la implementación del FetchAPI import 'whatwg-fetch'; // <-- yarn add whatwg-fetch -
kbitsr revised this gist
Mar 26, 2024 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,13 +3,13 @@ 1. Instalaciones: ``` npm install --dev jest babel-jest @babel/preset-env @babel/preset-react npm install --dev @testing-library/react @types/jest jest-environment-jsdom ``` 2. Opcional: Si usamos Fetch API en el proyecto: ``` npm install --dev whatwg-fetch ``` 3. Actualizar los scripts del __package.json__ @@ -19,7 +19,7 @@ yarn add --dev whatwg-fetch "test": "jest --watchAll" ``` 4. Crear la configuración de babel __babel.config.cjs__ ``` module.exports = { presets: [ @@ -31,15 +31,15 @@ module.exports = { 5. Opcional, pero eventualmente necesario, crear Jest config y setup: __jest.config.cjs__ ``` module.exports = { testEnvironment: 'jest-environment-jsdom', setupFiles: ['./jest.setup.js'] } ``` __jest.setup.cjs__ ``` // En caso de necesitar la implementación del FetchAPI import 'whatwg-fetch'; // <-- yarn add whatwg-fetch -
Klerith revised this gist
Apr 28, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,6 +30,7 @@ module.exports = { ``` 5. Opcional, pero eventualmente necesario, crear Jest config y setup: __jest.config.js__ ``` module.exports = { -
Klerith revised this gist
Apr 28, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ yarn add --dev @testing-library/react @types/jest jest-environment-jsdom yarn add --dev whatwg-fetch ``` 3. Actualizar los scripts del __package.json__ ``` "scripts: { ... -
Klerith revised this gist
Apr 28, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,7 +30,7 @@ module.exports = { ``` 5. Opcional, pero eventualmente necesario, crear Jest config y setup: __jest.config.js__ ``` module.exports = { testEnvironment: 'jest-environment-jsdom', -
Klerith revised this gist
Apr 28, 2022 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ # 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 -
Klerith created this gist
Apr 28, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ 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 ``` 2. Opcional: Si usamos Fetch API en el proyecto: ``` yarn add --dev whatwg-fetch ``` 3. Actualizar los scripts del __package.json___ ``` "scripts: { ... "test": "jest --watchAll" ``` 4. Crear la configuración de babel __babel.config.js__ ``` module.exports = { presets: [ [ '@babel/preset-env', { targets: { esmodules: true } } ], [ '@babel/preset-react', { runtime: 'automatic' } ], ], }; ``` 5. Opcional, pero eventualmente necesario, crear Jest config y setup: __jest.config.js___ ``` module.exports = { testEnvironment: 'jest-environment-jsdom', setupFiles: ['./jest.setup.js'] } ``` __jest.setup.js__ ``` // En caso de necesitar la implementación del FetchAPI import 'whatwg-fetch'; // <-- yarn add whatwg-fetch ```