Skip to content

Elevar cobertura de testes para 50%#66

Merged
leonelsanchesdasilva merged 2 commits intoprincipalfrom
copilot/increase-test-coverage-to-50
Mar 27, 2026
Merged

Elevar cobertura de testes para 50%#66
leonelsanchesdasilva merged 2 commits intoprincipalfrom
copilot/increase-test-coverage-to-50

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 27, 2026

Test coverage was well below 50% across all metrics (statements ~45%, branches ~30%, functions ~38%), with large portions of configuration, utility, and CLI modules having zero coverage.

New test files

  • testes/utilidades/gerador-expressoes.test.ts — Full coverage of all 13 GeradorExpressoes methods, including all 6 switch cases in gerarOperadorComparacao
  • testes/infraestrutura/centro-configuracoes.test.ts — Tests for all ConfiguracaoX classes using mock components, all ConfiguracaoComum.definirValor branch paths, and CentroConfiguracoes AST parsing at 1/2/3-level nesting depths
  • testes/interface-linha-comando/gerar.test.ts — Tests for obterTodosModelos, criarDiretorioSeNaoExiste, and criarDiretorioComIdSeNaoExiste with fs mocked
  • testes/utilidades/autenticacao-callback.test.ts — Tests the JWT strategy verify callback (user found / not found) via a passport-jwt mock that captures the callback

Modified test files

  • testes/infraestrutura/preprocessadores/foles.test.ts — Added coverage for the XML parse error path (catch), the no-cabeca path, and the cabeça (accented) fallback in the || branch

Bug fix

  • infraestrutura/centro-configuracoes/configuracao-comum.ts — Fixed a crash in definirValor where the error message referenced instancia[proximaPropriedade].constructor.name on a property that doesn't exist (always undefined); corrected to instancia.constructor.name

Coverage results

Metric Before After
Statements 44.91% 64.42%
Branches 29.66% 51.45%
Functions 37.93% 66.66%
Lines 44.49% 64.23%

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Agent-Logs-Url: https://github.com/DesignLiquido/liquido/sessions/468a2e39-3881-47ac-833b-5c5e018dad5b

Co-authored-by: leonelsanchesdasilva <53848829+leonelsanchesdasilva@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tests to increase coverage to 50% Elevar cobertura de testes para 50% Mar 27, 2026
@leonelsanchesdasilva leonelsanchesdasilva marked this pull request as ready for review March 27, 2026 19:05
@leonelsanchesdasilva leonelsanchesdasilva merged commit 8e5e371 into principal Mar 27, 2026
1 check passed
@leonelsanchesdasilva leonelsanchesdasilva deleted the copilot/increase-test-coverage-to-50 branch March 27, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Elevar cobertura de testes para 50%

2 participants