From 94c285768f5a93ec9154f9ed2eb7fa63ca3cd717 Mon Sep 17 00:00:00 2001 From: munoz138255 Date: Fri, 28 Mar 2025 11:25:30 +0100 Subject: [PATCH 1/4] [#1] - Debuggeando con console.log --- src/component/listItem/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/component/listItem/index.js b/src/component/listItem/index.js index 6b1b5a6..f2be006 100644 --- a/src/component/listItem/index.js +++ b/src/component/listItem/index.js @@ -7,6 +7,7 @@ class ListItem extends Component { const { title, desc } = this.props; if(!title){ + console.log("No hay título"); return null; } @@ -27,4 +28,4 @@ ListItem.propTypes = { desc: PropTypes.string } -export default ListItem; \ No newline at end of file +export default ListItem; From 7c7283c69589ced08acf61e4519095a868a8b844 Mon Sep 17 00:00:00 2001 From: munoz138255 Date: Tue, 1 Apr 2025 08:06:39 +0200 Subject: [PATCH 2/4] Cambio en index, debuggeando con console.log --- src/component/listItem/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/component/listItem/index.js b/src/component/listItem/index.js index f2be006..537cd39 100644 --- a/src/component/listItem/index.js +++ b/src/component/listItem/index.js @@ -7,7 +7,7 @@ class ListItem extends Component { const { title, desc } = this.props; if(!title){ - console.log("No hay título"); + console.log("No hay título"); return null; } From 10bbba7e17757c0bfcb1c2013e4749be4f37addc Mon Sep 17 00:00:00 2001 From: munoz138255 Date: Tue, 1 Apr 2025 08:39:15 +0200 Subject: [PATCH 3/4] Creacion del archivo de Jenkinsfile para el CI --- Jenkinsfile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..3f329ab --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,32 @@ +pipeline { + agent any + + stages { + stage('Checkout') { + steps { + git branch: 'feature/debugging_consoleLog', url: 'https://github.com/munoz138255/Testing-React-Redux-with-Jest-and-Enzyme' + } + } + + stage('Build') { + steps { + sh 'npm install' // Ajusta según tu stack + } + } + + stage('Testing') { + steps { + sh 'npm test' // Ejecuta los tests + } + } + } + + post { + success { + echo 'Build y testing completados con éxito.' + } + failure { + echo 'Error en la build o tests.' + } + } +} From f42f196e5a97b25e9bb9e5bbe9bb50cfd00baf24 Mon Sep 17 00:00:00 2001 From: munoz138255 Date: Tue, 1 Apr 2025 15:58:51 +0200 Subject: [PATCH 4/4] Creacion del CI de Jenkinsfile --- Jenkinsfile-ci | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Jenkinsfile-ci diff --git a/Jenkinsfile-ci b/Jenkinsfile-ci new file mode 100644 index 0000000..a766065 --- /dev/null +++ b/Jenkinsfile-ci @@ -0,0 +1,45 @@ +pipeline { + agent any + + environment { + DEPLOY_DIR = '/home/alumno/Documentos/Usuarios/practica9/Testing-React-Redux-with-Jest-and-Enzyme' + } + + stages { + stage('Checkout') { + steps { + script { + // Clonar el código en la rama feature actual + git branch: env.BRANCH_NAME, url: 'https://github.com/munoz138255/Testing-React-Redux-with-Jest-and-Enzyme.git' + } + } + } + + stage('Build') { + steps { + script { + echo "Construyendo proyecto en la rama ${env.BRANCH_NAME}" + sh 'npm install' + } + } + } + + stage('Testing') { + steps { + script { + echo "Ejecutando pruebas en la rama ${env.BRANCH_NAME}" + sh 'npm test' + } + } + } + } + + post { + success { + echo 'Pipeline CI ejecutado correctamente en la rama feature.' + } + failure { + echo 'Hubo un error en la ejecución del pipeline CI.' + } + } +}