Skip to content
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

Feature/alog 266 configurar teste unitario no repositorio impulso previne #319

Conversation

jvns2010
Copy link
Contributor

@jvns2010 jvns2010 commented Feb 6, 2025

Summary by CodeRabbit

  • Testes
    • Implementada uma configuração aprimorada para o ambiente de testes com Jest, garantindo melhor compatibilidade com aplicações Next.js.
    • Adicionados novos comandos para execução de testes: "test", "test:watch" e "test:coverage".
    • Atualizadas as dependências de teste, incluindo novas bibliotecas para melhorar as asserções relacionadas ao DOM e suporte ao TypeScript.
    • Adicionado um novo teste para verificar a renderização do componente Home com elementos dinâmicos.

Copy link

linear bot commented Feb 6, 2025

Copy link

vercel bot commented Feb 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
impulso-previne ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 18, 2025 2:35pm

Copy link

coderabbitai bot commented Feb 6, 2025

"""

Walkthrough

Este pull request adiciona um arquivo de configuração do Jest (jest.config.ts) preparado para a integração com uma aplicação Next.js, definindo opções como ambiente jsdom, coleta de cobertura e alias de módulos. Além disso, o package.json foi atualizado para incluir novos scripts de teste e diversas dependências e devDependencies de bibliotecas de testes, permitindo a execução de testes utilizando Jest com suporte a TypeScript. O arquivo jest.setup.ts foi modificado para importar a biblioteca @testing-library/jest-dom, ampliando as capacidades de teste. Um novo arquivo de teste foi criado para o componente Home, validando sua renderização correta.

Changes

Arquivo(s) Resumo das Alterações
jest.config.ts Criação de configuração do Jest usando nextJest, definição de alias de módulos, ambiente "jsdom", coleta de cobertura e exportação do objeto de configuração.
package.json Adição dos scripts "test": "jest", "test:watch": "jest --watch" e "test:coverage": "jest --coverage", além da inclusão de novas devDependencies para testes: @testing-library/dom, @testing-library/jest-dom, @testing-library/react, jest, jest-environment-jsdom, ts-node, @types/jest.
jest.setup.ts Importação da biblioteca @testing-library/jest-dom para estender as asserções do Jest para elementos DOM.
tests/home.test.tsx Criação de um novo arquivo de teste para o componente Home, incluindo um caso de teste que verifica a renderização correta de elementos dinâmicos.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Desenvolvedor
  participant CLI as Linha de Comando
  participant Jest as Jest Test Runner
  participant App as Aplicação (Next.js)

  Dev->>CLI: Executa "npm test"
  CLI->>Jest: Inicia testes com jest.config.ts
  Jest->>App: Simula ambiente jsdom e executa casos de teste
  App-->>Jest: Retorna resultados dos testes
  Jest-->>CLI: Exibe relatório de teste
Loading

Poem

Sou um coelhinho saltitante,
Com novidades no meu code brilhante,
Configuração de testes a brilhar,
Com Jest e Next.js a integrar,
Pulando de alegria, faço meu verso cantar!
🐇✨
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d2a4aca and 195c0ca.

📒 Files selected for processing (1)
  • package.json (3 hunks)
🔇 Additional comments (3)
package.json (3)

18-21: Validação dos Scripts e Configuração do Husky

Os scripts para execução de testes foram adicionados ("test", "test:watch" e "test:coverage"), o que melhora a integração dos testes via Jest. Além disso, foi incluída a entrada "postinstall": "husky". Verifique se o comando utilizado ativa corretamente os hooks do Husky – por exemplo, considere utilizar "husky install" se for necessário.


71-71: Atualização dos Tipos do Jest

A versão "@types/jest": "^29.5.14" foi definida, o que aparenta estar em linha com as expectativas para o ambiente de testes.


82-84: Validação das Dependências do Jest e ts-node

Foram adicionadas as dependências "jest", "jest-environment-jsdom" e "ts-node" com versões recentes, garantindo suporte adequado para testes em ambiente jsdom e integração com TypeScript. Confirme se essas versões interagem corretamente com o restante da configuração do projeto.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
jest.config.ts (1)

14-68: Adicionar arquivos de configuração do ambiente de teste

A configuração básica está correta, mas é recomendado adicionar arquivos de setup para melhorar o ambiente de testes.

Sugiro adicionar a seguinte configuração:

  // The paths to modules that run some code to configure or set up the testing framework before each test
- // setupFilesAfterEnv: [],
+ setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],

E criar um arquivo jest.setup.ts com o seguinte conteúdo:

import '@testing-library/jest-dom';

// Extend expect matchers
expect.extend({});

// Setup global mocks if needed
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1458029 and 418a22d.

📒 Files selected for processing (2)
  • jest.config.ts (1 hunks)
  • package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (5)
jest.config.ts (3)

1-12: Configuração inicial do Jest correta!

A configuração está utilizando corretamente o nextJest para compatibilidade com Next.js.


167-167: Ambiente de teste configurado corretamente!

O uso do ambiente "jsdom" é apropriado para testes de aplicações React.


99-111: Verificar estrutura de diretórios do projeto

O mapeamento de módulos está bem estruturado, mas é importante verificar se todos os diretórios mapeados existem no projeto.

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Verificar se os diretórios mapeados existem
for dir in src/hooks src/componentes src/services src/helpers src/utils src/constants src/middlewares prisma src/types src/data; do
  if [ ! -d "$dir" ]; then
    echo "Diretório não encontrado: $dir"
  fi
done

Length of output: 1586


Verificação dos diretórios mapeados em jest.config.ts

Após a verificação dos diretórios listados na propriedade moduleNameMapper, não foi gerada nenhuma mensagem de erro, indicando que todos os diretórios configurados (src/hooks, src/componentes, src/services, src/helpers, src/utils, src/constants, src/middlewares, prisma, src/types e src/data) existem no projeto.

package.json (2)

43-44: ⚠️ Potential issue

Corrigir versão do React

A versão 19.0.0 do React parece estar incorreta, pois esta versão ainda não foi lançada oficialmente.

Recomendo atualizar para a última versão estável do React:

-    "react": "19.0.0",
-    "react-dom": "19.0.0",
+    "react": "18.2.0",
+    "react-dom": "18.2.0",

52-54: Verificar compatibilidade das versões do Testing Library

As versões das dependências do Testing Library podem estar desatualizadas ou incompatíveis:

  • @testing-library/react v16.2.0 é muito antiga
  • @testing-library/dom v10.4.0 pode ser incompatível
✅ Verification successful

🌐 Web query:

What is the latest version of @testing-library/react that is compatible with React 19.0.0?

💡 Result:

The latest compatible version of `@testing-library/react` with **React 19** is **v16.x**, specifically **v16.2.0** or newer[1][4]. Here's what you need to know:

### Key Requirements
- **React Testing Library v16+** requires **React ≥18** as a base dependency[1][4].
- For **React 19**, ensure:
  1️⃣ `@testing-library/dom` is installed alongside it[1][4]:
   ```bash
   npm install --save-dev @testing-library/react@latest @testing-library/dom
   ```
  2️⃣ Peer dependencies include both **React ≥18** and **React DOM ≥18** in your project[1][4].

### Compatibility Verification
Check if your installed version supports React 19 by running:
```bash
npm info @testing-library/react peerDependencies
```
This should show:
```json
{
 "react": "^16 || ^17 || ^18 || ^19",
 "react-dom": "^16 || ^17 || ^18 || ^19"
}
```

### Common Pitfalls
- Projects using **React Testing Library ≤v12** will fail with React 19[6][9]
- Some libraries like `react-test-renderer` are deprecated for React 19 - use `@testing-library/react` instead[7]

For new projects starting with React 19:
```bash
npx create-react-app@latest my-app --template react-19
```

Citations:

- 1: https://www.npmjs.com/package/@testing-library/react
- 2: https://ui.shadcn.com/docs/react-19
- 3: https://forum.ionicframework.com/t/tests-not-working-upgrading-node-version-14-16/242802
- 4: https://github.com/testing-library/react-testing-library/releases
- 5: https://react.dev/blog/2024/12/05/react-19
- 6: https://github.com/facebook/react/issues/32016
- 7: https://www.npmjs.com/package/react-test-renderer
- 8: https://github.com/facebook/react/blob/main/CHANGELOG.md
- 9: https://intellij-support.jetbrains.com/hc/en-us/community/posts/23121608286994-Not-possible-instal-React-from-New-Project-npx-create-react-app
- 10: https://testing-library.com/docs/react-testing-library/intro/

Verificação de compatibilidade das versões do Testing Library

Após análise e consulta à referência web, concluímos que a versão instalada de @testing-library/react (v16.2.0) é compatível com React 19, sendo considerada a versão mínima necessária para essa compatibilidade. Da mesma forma, não há evidências de incompatibilidade com a versão @testing-library/dom (v10.4.0) sob os requisitos atuais.

@jvns2010
Copy link
Contributor Author

@coderabbitai give me an example of a global mock for dynamic imports

Copy link

coderabbitai bot commented Feb 13, 2025

Tip

For best results, initiate chat on the files or code changes.

@jvns2010 Here's an example of how to set up a global mock for dynamic imports:

  1. First, create a setup file jest.setup.ts:
// jest.setup.ts
jest.mock('next/dynamic', () => ({
  __esModule: true,
  default: (...props: any) => {
    const DynamicComponent = (props: any) => null;
    DynamicComponent.displayName = 'DynamicComponent';
    DynamicComponent.preload = async () => undefined;
    return DynamicComponent;
  },
}));
  1. Update your jest.config.ts to include the setup file:
const nextJest = require('next/jest');

const createJestConfig = nextJest({
  dir: './',
});

const config = {
  setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
  // ... rest of your config
};

export default createJestConfig(config);

Now all dynamic imports in your tests will automatically use this mock. For example, when testing a component that uses dynamic imports:

// Your component
import dynamic from 'next/dynamic';
const DynamicHeader = dynamic(() => import('./Header'));

// Your test
describe('Component with dynamic import', () => {
  it('renders without crashing', () => {
    // The dynamic import will use the mock automatically
    render(<DynamicHeader />);
  });
});

✏️ Learnings added
Learnt from: jvns2010
URL: https://github.com/ImpulsoGov/ImpulsoPrevine/pull/319

Timestamp: 2025-02-13T17:51:00.583Z
Learning: For Next.js projects using Jest, dynamic imports can be mocked globally by creating a jest.setup.ts file with a mock for 'next/dynamic' and configuring it in jest.config.ts using setupFilesAfterEnv.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
package.json (1)

7-19: Sugestão de melhoria para o script de teste

O script de teste atual está muito básico. Considere adicionar configurações adicionais para melhorar a experiência de desenvolvimento.

Sugestão de modificação:

-    "test": "jest"
+    "test": "jest",
+    "test:watch": "jest --watch",
+    "test:coverage": "jest --coverage",
+    "test:ci": "jest --ci --coverage --maxWorkers=2"

Estas adições permitirão:

  • Modo watch para desenvolvimento
  • Relatório de cobertura de testes
  • Configuração otimizada para CI
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 418a22d and 940b3b7.

📒 Files selected for processing (3)
  • jest.config.ts (1 hunks)
  • jest.setup.ts (1 hunks)
  • package.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • jest.setup.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • jest.config.ts
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
package.json (3)

2-5: Configuração básica do projeto está correta!

A configuração do projeto como módulo ES (type: "module") está alinhada com as melhores práticas para projetos Next.js modernos.


43-44: ⚠️ Potential issue

❌ Incorrect review comment

Versão incorreta do React

A versão 19.0.0 do React especificada não existe ainda. Isso pode causar problemas de instalação e compatibilidade.

Recomendo atualizar para a versão estável mais recente do React:

-    "react": "19.0.0",
-    "react-dom": "19.0.0",
+    "react": "18.2.0",
+    "react-dom": "18.2.0",

🌐 Web query:

What is the latest stable version of React?

💡 Result:

The latest stable version of React is 19.0, released on December 5, 2024[2][4][5]. This major update introduced features like Actions, new hooks (useActionState, useFormStatus, useOptimistic), Server Components/Server Actions, improved Context API support[3][4], and removed several deprecated APIs[5].

Key details:

  • Available on npm as [email protected][8][9]
  • Requires the New JSX Transform introduced in earlier versions[5]
  • Includes breaking changes from deprecated APIs like string refs and legacy context[5]
  • Follows semantic versioning (SemVer)[2]

New projects created today will automatically use React 19 through tools like Create React App[1]. For existing projects upgrading from v18.x, a migration guide is available to address breaking changes[4][5].

Citations:


Confirmação da Versão do React

Após verificação, constatamos que a versão 19.0.0 do React especificada em package.json é a versão estável mais recente, conforme confirmado pela consulta web. Portanto, a recomendação de alteração para a versão 18.2.0 não se aplica.

Por favor, desconsidere o comentário anterior referente à versão incorreta do React.

Likely an incorrect or invalid review comment.


52-54: ⚠️ Potential issue

❌ Incorrect review comment

Incompatibilidade entre versões das bibliotecas de teste

Existem incompatibilidades potenciais entre as versões das bibliotecas de teste:

  • @testing-library/react v16.2.0 é muito antiga e pode ser incompatível com React 18+
  • @testing-library/dom v10.4.0 pode ter problemas de compatibilidade com as outras versões

Recomendo atualizar para versões compatíveis:

-    "@testing-library/dom": "^10.4.0",
-    "@testing-library/react": "^16.2.0",
+    "@testing-library/dom": "^9.3.4",
+    "@testing-library/react": "^14.2.1",

Also applies to: 67-68


🌐 Web query:

What are the latest compatible versions of @testing-library/react and @testing-library/dom for React 18?

💡 Result:

The latest compatible versions for React 18 are:

@testing-library/react v16+

  • Requires explicit installation of @testing-library/[email protected]+ as a peer dependency[9][7]
  • Supports all React 18 features and testing patterns like async findBy* queries[1][4]

Key compatibility details:

  • RTL v13+ officially supports React 18[9]
  • Version 16 introduced breaking changes requiring DOM Testing Library as explicit dependency[7]
  • Testing Library v14+ includes React Hooks testing utilities (no separate react-hooks-testing-library needed)[1]

For TypeScript projects:

npm install --save-dev @testing-library/react@16 @testing-library/dom@10
# or
yarn add --dev @testing-library/react@16 @testing-library/dom@10

Important migration notes:

  • Remove deprecated @testing-library/react-hooks[1][6]
  • Update test patterns to use async queries (findBy*) instead of manual act() calls[1][4]
  • Ensure proper cleanup with afterEach(cleanup) removed in v14+[2][9]

Citations:


Verificação de compatibilidade das dependências de teste com React 18

Após consultar a documentação e os resultados da pesquisa, constatei que:

  • @testing-library/react v16.2.0 e @testing-library/dom v10.4.0 já estão alinhados com as recomendações oficiais para React 18, que sugerem utilizar versões a partir de v16 para o React Testing Library e a partir de v10.4 para o DOM Testing Library.
  • A sugestão de alteração para versões inferiores (v14.2.1 para React e v9.3.4 para DOM) não é apropriada e pode, inclusive, trazer regressões ou incompatibilidades.

Recomendações:

  • Mantenha as versões atuais no package.json para garantir a compatibilidade com o React 18.
  • Verifique também se, em outros trechos (como nos referenciados em linhas 67-68), a configuração está coerente com essas versões.

Likely an incorrect or invalid review comment.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
package.json (1)

7-7: Melhore os scripts de teste

Considere adicionar scripts de teste adicionais para melhorar a experiência de desenvolvimento:

 "scripts": {
   "dev": "next dev --turbopack",
   ...
-  "test": "jest"
+  "test": "jest",
+  "test:watch": "jest --watch",
+  "test:coverage": "jest --coverage"
 }

Also applies to: 19-19

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 940b3b7 and 5b45a29.

📒 Files selected for processing (1)
  • package.json (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
package.json (2)

90-93: Atualize as resoluções de tipos do React

As versões dos tipos do React nas resoluções precisam ser atualizadas para corresponder à versão correta do React.


51-51:

❓ Verification inconclusive

Verifique a compatibilidade entre Next.js, React e bibliotecas de teste

É importante garantir que as versões do Next.js e React sejam compatíveis entre si e com as bibliotecas de teste.

Also applies to: 56-56, 57-57


🌐 Web query:

What are the peer dependencies for Next.js 15.1.6?

💡 Result:

Next.js 15.1.6 requires React 19 and React-DOM 19 as core peer dependencies[7][8]. This version enforces compatibility with React 19's new features like Actions API and enhanced hooks[7][8].

Key points about dependencies:

  • Minimum React versions: react@^19.0.0 and react-dom@^19.0.0[8]
  • TypeScript: Requires updated @types/react and @types/react-dom packages when using TypeScript[8]
  • Common conflicts: Packages requiring older React versions (like [email protected] needing React 18) may require --legacy-peer-deps flag during installation[2][4]

The dependency structure appears in package.json as:

{
  "dependencies": {
    "next": "15.1.6",
    "react": "^19.0.0",
    "react-dom": "^19.0.0"
  }
}

When upgrading from previous versions, you must update both React and Next.js simultaneously[8]. Some third-party libraries like @radix-ui/react-icons may require legacy peer dependency handling until they update their React compatibility[4][9].

Citations:


Compatibilidade de Dependências entre Next.js, React e Bibliotecas de Teste

  • Verifique se o projeto utiliza, além do Next.js 15.1.6, as versões compatíveis do React e do React-DOM (mínimo: "react": "^19.0.0" e "react-dom": "^19.0.0"), conforme exigido pela versão do Next.js.
  • Certifique-se de que as bibliotecas de teste (e quaisquer outras dependências que interajam com o React) sejam compatíveis com o React 19. Caso alguma delas exija versões anteriores, avalie a atualização ou o uso de flags como --legacy-peer-deps na instalação.
  • Aplique a verificação também para as linhas 56-56 e 57-57, garantindo que eventuais ajustes relacionados ao React sejam consistentes.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
__tests__/home.test.tsx (1)

3-12: Melhore a implementação dos mocks para incluir validação de props

Os mocks atuais são muito simplificados e não validam as props recebidas. Isso pode ocultar problemas de tipagem ou validação de props durante os testes.

Aplique este diff para melhorar a implementação:

 jest.mock("@impulsogov/design-system", () => ({
-	FormConsultoria: (props) => <div>FormConsultoria Mock</div>,
+	FormConsultoria: ({ children, ...props }) => (
+		<div data-testid="form-consultoria" {...props}>
+			{children}
+			FormConsultoria Mock
+		</div>
+	),
-	TituloSmallTexto: (props) => <div>TituloSmallTexto Mock</div>,
+	TituloSmallTexto: ({ texto, ...props }) => (
+		<div data-testid="titulo-small-texto" {...props}>
+			{texto || 'TituloSmallTexto Mock'}
+		</div>
+	),
 	// Aplicar o mesmo padrão para os outros componentes
}));
🧰 Tools
🪛 Biome (1.9.4)

[error] 4-4: This object property name should be in camelCase.

(lint/style/useNamingConvention)


[error] 4-4: This parameter is unused.

Unused parameters might be the result of an incomplete refactoring.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedFunctionParameters)


[error] 4-4: This parameter is unused.

Unused variables usually are result of incomplete refactoring, typos and other source of bugs.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedVariables)


[error] 5-5: This object property name should be in camelCase.

(lint/style/useNamingConvention)


[error] 5-5: This parameter is unused.

Unused parameters might be the result of an incomplete refactoring.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedFunctionParameters)


[error] 5-5: This parameter is unused.

Unused variables usually are result of incomplete refactoring, typos and other source of bugs.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedVariables)


[error] 6-6: This object property name should be in camelCase.

(lint/style/useNamingConvention)


[error] 6-6: This parameter is unused.

Unused parameters might be the result of an incomplete refactoring.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedFunctionParameters)


[error] 6-6: This parameter is unused.

Unused variables usually are result of incomplete refactoring, typos and other source of bugs.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedVariables)


[error] 7-7: This object property name should be in camelCase.

(lint/style/useNamingConvention)


[error] 7-7: This parameter is unused.

Unused parameters might be the result of an incomplete refactoring.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedFunctionParameters)


[error] 7-7: This parameter is unused.

Unused variables usually are result of incomplete refactoring, typos and other source of bugs.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedVariables)


[error] 8-8: This object property name should be in camelCase.

(lint/style/useNamingConvention)


[error] 8-8: This parameter is unused.

Unused parameters might be the result of an incomplete refactoring.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedFunctionParameters)


[error] 8-8: This parameter is unused.

Unused variables usually are result of incomplete refactoring, typos and other source of bugs.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedVariables)


[error] 9-9: This object property name should be in camelCase.

(lint/style/useNamingConvention)


[error] 9-9: This parameter is unused.

Unused parameters might be the result of an incomplete refactoring.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedFunctionParameters)


[error] 9-9: This parameter is unused.

Unused variables usually are result of incomplete refactoring, typos and other source of bugs.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedVariables)


[error] 10-10: This object property name should be in camelCase.

(lint/style/useNamingConvention)


[error] 10-10: This parameter is unused.

Unused parameters might be the result of an incomplete refactoring.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedFunctionParameters)


[error] 10-10: This parameter is unused.

Unused variables usually are result of incomplete refactoring, typos and other source of bugs.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedVariables)


[error] 11-11: This object property name should be in camelCase.

(lint/style/useNamingConvention)


[error] 11-11: This parameter is unused.

Unused parameters might be the result of an incomplete refactoring.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedFunctionParameters)


[error] 11-11: This parameter is unused.

Unused variables usually are result of incomplete refactoring, typos and other source of bugs.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedVariables)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5b45a29 and d2a4aca.

📒 Files selected for processing (1)
  • __tests__/home.test.tsx (1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
__tests__/home.test.tsx

[error] 4-4: This object property name should be in camelCase.

(lint/style/useNamingConvention)


[error] 4-4: This parameter is unused.

Unused parameters might be the result of an incomplete refactoring.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedFunctionParameters)


[error] 4-4: This parameter is unused.

Unused variables usually are result of incomplete refactoring, typos and other source of bugs.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedVariables)


[error] 5-5: This object property name should be in camelCase.

(lint/style/useNamingConvention)


[error] 5-5: This parameter is unused.

Unused parameters might be the result of an incomplete refactoring.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedFunctionParameters)


[error] 5-5: This parameter is unused.

Unused variables usually are result of incomplete refactoring, typos and other source of bugs.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedVariables)


[error] 6-6: This object property name should be in camelCase.

(lint/style/useNamingConvention)


[error] 6-6: This parameter is unused.

Unused parameters might be the result of an incomplete refactoring.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedFunctionParameters)


[error] 6-6: This parameter is unused.

Unused variables usually are result of incomplete refactoring, typos and other source of bugs.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedVariables)


[error] 7-7: This object property name should be in camelCase.

(lint/style/useNamingConvention)


[error] 7-7: This parameter is unused.

Unused parameters might be the result of an incomplete refactoring.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedFunctionParameters)


[error] 7-7: This parameter is unused.

Unused variables usually are result of incomplete refactoring, typos and other source of bugs.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedVariables)


[error] 8-8: This object property name should be in camelCase.

(lint/style/useNamingConvention)


[error] 8-8: This parameter is unused.

Unused parameters might be the result of an incomplete refactoring.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedFunctionParameters)


[error] 8-8: This parameter is unused.

Unused variables usually are result of incomplete refactoring, typos and other source of bugs.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedVariables)


[error] 9-9: This object property name should be in camelCase.

(lint/style/useNamingConvention)


[error] 9-9: This parameter is unused.

Unused parameters might be the result of an incomplete refactoring.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedFunctionParameters)


[error] 9-9: This parameter is unused.

Unused variables usually are result of incomplete refactoring, typos and other source of bugs.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedVariables)


[error] 10-10: This object property name should be in camelCase.

(lint/style/useNamingConvention)


[error] 10-10: This parameter is unused.

Unused parameters might be the result of an incomplete refactoring.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedFunctionParameters)


[error] 10-10: This parameter is unused.

Unused variables usually are result of incomplete refactoring, typos and other source of bugs.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedVariables)


[error] 11-11: This object property name should be in camelCase.

(lint/style/useNamingConvention)


[error] 11-11: This parameter is unused.

Unused parameters might be the result of an incomplete refactoring.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedFunctionParameters)


[error] 11-11: This parameter is unused.

Unused variables usually are result of incomplete refactoring, typos and other source of bugs.
Unsafe fix: If this is intentional, prepend props with an underscore.

(lint/correctness/noUnusedVariables)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript-typescript)

@jvns2010 jvns2010 requested a review from vhbsouza February 14, 2025 07:09
@jvns2010 jvns2010 marked this pull request as ready for review February 14, 2025 07:10
@mverardo
Copy link

Durante o mob, decidimos que este PR vai se limitar a adicionar a infra dos testes para tornar possível rodar testes de unidade com o Jest, mas não escrever os testes especificamente, dado que isso seria um esforço muito grande, e poderia acontecer organicamente conforme vamos escrevendo código novo.

@jvns2010 jvns2010 dismissed vhbsouza’s stale review February 18, 2025 15:00

Decidimos em conjunto aprovar o PR durante o mob.

@jvns2010 jvns2010 merged commit b853ebb into main Feb 18, 2025
5 checks passed
@jvns2010 jvns2010 deleted the feature/alog-266-configurar-teste-unitario-no-repositorio-impulso-previne branch February 18, 2025 15:00
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.

3 participants