Traducción de archivo src/controllers/write/groups.js a un archivo Typescript#47
Open
amarantaVC wants to merge 4 commits intoUSB-CI3715:f24from
Open
Traducción de archivo src/controllers/write/groups.js a un archivo Typescript#47amarantaVC wants to merge 4 commits intoUSB-CI3715:f24from
amarantaVC wants to merge 4 commits intoUSB-CI3715:f24from
Conversation
…roupsjs Modificacion para resolver problemas con npm run test
Pull Request Test Coverage Report for Build 11318458800Details
💛 - Coveralls |
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 characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Este Pull Request resuelve el Issues #14 (fixes #14), en el cual se tenía como tarea traducir el archivo src/controllers/write/groups.js a Typescript.
Principales cambios: :
Tipificación de parámetros y retornos:
Se agregaron los tipos de Request y Response de Express en los parametros de todas las funciones.
Se definió el tipo de retorno de las funciones como Promise
Tipificación de variables:
Se añadió el tipo unknown con el fin de que los resultados de las funciones externas que aun no han sido traducidas a typescript no generarán error.
Se especifico el objeto groupObj de la función update como Record<string, unknown>
Comentarios de ESlint:
Se agregaron comentarios a lo largo del codigo como @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, /* eslint-disable import/no-import-module-exports */ con el fin de evitar errores con el linter.
Cambio en la importación de los modulos:
Se hizo uso de Request y Response desde express para las importaciones para asegurar el manejo correcto con las tipificaciones necesarias.
Cambios del archivo tsconfig.json
Se modificó el archivo tsconfig.json para que el target del archivo trabajara con es2017 en vez de es6, con el fin de permitir el uso de las funciones de async y await.
Pruebas:
El test de coverage arrojó una covertura alta de 83%
Se paso el linter de manera exitosa
Amaranta Villegas
carnet: 16-11247