-
Notifications
You must be signed in to change notification settings - Fork 0
Testing strategy #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing strategy #76
Conversation
* Documentación de la estrategia de testing, incluyendo tipos de tests, herramientas y mejores prácticas. * Reorganización de pruebas unitarias * Renombrado del workflow de Playwright a "tests.yml" para reflejar mejor su propósito.
* Test A11yActions como verdadero ejemplo * Ejemplos de codigo usando alias import
El script lee el archivo.env y luego ejecuta playwright test
Ahora se instalan las siguientes extensiones * vitest * playwright * eslint
|
|
✅ Deploy Preview for secorto-astro ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
SeCOrTo web
|
||||||||||||||||||||||||||||
| Project |
SeCOrTo web
|
| Branch Review |
pull/76/head
|
| Run status |
|
| Run duration | 01m 37s |
| Commit |
|
| Committer | Sergio Orozco |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
6
|
| View all changes introduced in this branch ↗︎ | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Actualiza la estrategia de testing del repo (unit con Vitest y E2E con Playwright), agrega cobertura y lint al pipeline de CI, y refuerza tooling/configuración para tests y linting en un proyecto Astro + TypeScript.
Changes:
- Añade/ajusta configuración de Vitest (setup global + aliases) y nuevos unit tests para utils e i18n.
- Actualiza el workflow de GitHub Actions para correr lint + unit con coverage y E2E en paralelo; renombra el workflow a “Tests”.
- Elimina
dotenvdel setup de Playwright y documenta cómo ejecutar E2E con variables de entorno; endurece ESLint.
Reviewed changes
Copilot reviewed 32 out of 40 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.ts | Añade aliases y setup file para unit tests |
| tsconfig.json | Añade path alias @github/* |
| tests/unit/wait-netlify.fetch.test.ts | Elimina test antiguo (migrado a otra ruta) |
| tests/unit/utils/sectionLoader.test.ts | Nuevo unit test para sectionLoader |
| tests/unit/utils/rssBuilder.test.ts | Nuevo unit test para rssBuilder |
| tests/unit/utils/paths.test.ts | Nuevo unit test para paths utils |
| tests/unit/infraestructure/wait-netlify.test.ts | Ajusta imports a alias + tipado en test |
| tests/unit/infraestructure/wait-netlify.runner.test.ts | Corrige rutas relativas a runner/scripts |
| tests/unit/infraestructure/wait-netlify.run.test.ts | Ajusta imports a alias + captura exit code |
| tests/unit/infraestructure/wait-netlify.resolve.test.ts | Ajuste de import + cleanup más seguro de temp file |
| tests/unit/infraestructure/wait-netlify.print.test.ts | Ajusta imports a alias |
| tests/unit/infraestructure/wait-netlify.poll.test.ts | Ajusta imports a alias |
| tests/unit/infraestructure/wait-netlify.main.test.ts | Ajusta mocks/imports a alias |
| tests/unit/infraestructure/wait-netlify.fetch.test.ts | Nuevo test para guard de fetch |
| tests/unit/infraestructure/wait-netlify.ensure.test.ts | Ajusta imports a alias (con un caso restante relativo) |
| tests/unit/infraestructure/wait-netlify.branch.test.ts | Ajusta imports a alias |
| tests/unit/infraestructure/wait-netlify-validate.test.ts | Ajusta imports a alias |
| tests/unit/infraestructure/wait-netlify-api.test.ts | Simplifica setup/teardown y usa alias |
| tests/unit/i18n/utils.test.ts | Nuevos unit tests para utils i18n |
| tests/unit/i18n/rootMap.test.ts | Nuevos unit tests para rootMap i18n |
| tests/unit/i18n/buildTranslationMap.test.ts | Nuevo unit test para buildTranslationMap |
| tests/setup.ts | Setup global de Vitest (silenciar console + restore mocks + mock astro:content) |
| tests/actions/A11yActions.ts | Envuelve análisis axe en test.step |
| src/env.d.ts | Ajuste de inclusión de tipos Astro |
| src/content.config.ts | Reemplaza any por ImageFunction en schema helper |
| src/components/PostDate.astro | Ajustes de indentación/format |
| src/components/ListWork.astro | Ajustes de indentación/format |
| src/components/BlogTalkPostView.astro | Ajustes de indentación/format |
| playwright.config.ts | Elimina carga automática de .env con dotenv |
| package.json | Scripts nuevos E2E + elimina dotenv + agrega typescript-eslint plugin |
| package-lock.json | Sync lockfile (remove dotenv, engines, eslint plugin) |
| eslint.config.js | ESLint más estricto + typescript-eslint plugin + ignores |
| docs/TESTING_STRATEGY.md | Nuevo documento de estrategia de testing |
| cypress/e2e/stubs.ts | Ajustes de indentación + suppress de no-explicit-any localizado |
| cypress/e2e/main-page.cy.ts | Fix de bracket/indent |
| cypress/e2e/blog.cy.ts | Fix de bracket/indent |
| README.md | Documenta comandos de testing y uso de env vars en E2E |
| .github/workflows/tests.yml | Nuevo workflow “Tests” con unit+lint y E2E + artifacts |
| .github/copilot-instructions.md | Añade guía: unit tests + @ts-check/JSDoc para JS utilitario |
| .devcontainer/devcontainer.json | Actualiza Node image + extensiones recomendadas |
Comments suppressed due to low confidence (2)
tests/unit/infraestructure/wait-netlify.ensure.test.ts:54
- In this file, most tests import the module as
@github/scripts/wait-netlify.js, but the last test imports it via a relative path (../../../.github/scripts/wait-netlify.js). Importing the same module under different specifiers can create multiple module instances and makevi.resetModules()/mocks behave inconsistently. Use the same specifier (@github/...) throughout this suite.
.github/workflows/tests.yml:36 - The YAML indentation under both jobs is invalid:
steps:is followed by list items (- uses,- name, etc.) at the same indentation level, but sequence items must be indented understeps:(e.g.,steps:\n - ...). As written, this workflow will fail to parse and won’t run in GitHub Actions.
Disabled rule import/no-unresolved and explained the reason
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 36 out of 44 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
tests/unit/infraestructure/wait-netlify.ensure.test.ts:54
- This import uses a relative path (
../../../.github/...) while the rest of the file uses the new@github/...alias. For consistency (and to avoid future path mistakes if the test file moves), switch this import to use@github/scripts/wait-netlify.jslike the others.
* npm run test:unit no genera cobertura * Copilot instructions tenia mal la indentation en Testing guidance * Eliminado bloque redundante when refactoring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 36 out of 44 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
tests/unit/infraestructure/wait-netlify.ensure.test.ts:54
- This test imports
wait-netlify.jsvia a deep relative path, while the rest of the suite uses the new@github/...alias. Keeping a single import style reduces path mistakes and ensures the Vitest/TS alias configuration is actually exercised. Consider switching this import to@github/scripts/wait-netlify.jsfor consistency.
|
|
||
| | Command | Acción | | ||
| | :------------------ | :--------------------------------------------------------------- | | ||
| | `npm run test` | Ejecuta las pruebas E2E (Playwright/Cypress según configuración) | |
Copilot
AI
Feb 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new Tests section says npm run test runs E2E tests with “Playwright/Cypress”, but package.json currently defines test as cypress run. Either update the documentation to match the current command behavior, or change the test script to reflect the intended default E2E runner.
| | `npm run test` | Ejecuta las pruebas E2E (Playwright/Cypress según configuración) | | |
| | `npm run test` | Ejecuta las pruebas E2E con Cypress (`cypress run`) | |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Pull request