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

feat: cypress #272

Merged
merged 13 commits into from
Jul 1, 2024
Merged

feat: cypress #272

merged 13 commits into from
Jul 1, 2024

Conversation

samufacanha2
Copy link
Collaborator

@samufacanha2 samufacanha2 commented Jun 25, 2024

Summary by CodeRabbit

  • Novos Recursos

    • Adicionadas novas suítes de teste Cypress para navegação, páginas de contas, transações, validadores e barra de pesquisa.
  • Correções de Bugs

    • Alterado o manuseio de erro na função getPrecision para usar console.error em vez de throw new Error.
  • Melhoria de Testes

    • Substituição dos scripts de teste Jest por scripts de teste Cypress.
    • Adicionados vários atributos data-testid para facilitar testes de componentes.
  • Estilização

    • Atualização de seletores CSS para utilizar &: em vez de :, melhorando a aplicação de estilos em pseudo-classes.
  • Outros

    • Remoção de dependências relacionadas ao Jest e adição de dependências relacionadas ao Cypress.

Copy link

coderabbitai bot commented Jun 25, 2024

Walkthrough

As mudanças ajustam a configuração do CI, substituindo Jest por Cypress para testes end-to-end, adicionando novos testes Cypress e ajustando estilizações nos componentes React. Modificações incluem melhorias na configuração de tempo e fuso horário, simplificações na lógica do código, e adição de atributos data-testid para facilitar testes.

Changes

Arquivo Resumo das Mudanças
.github/workflows/node.js.yml Reestruturação e adição de passos no workflow CI para Node.js, incluindo configuração de Cypress.
cypress.config.ts, package.json, tsconfig.json Substituição de Jest por Cypress nos scripts de teste e dependências.
cypress/e2e/... Adição de novos testes end-to-end utilizando o Cypress.
src/components/..., src/contexts/... Ajustes em pseudo-classes CSS (:active, :visited, etc.) e adição de atributos data-testid.
src/pages/... Adição de atributos data-testid e ajustes em exibições de dados.
src/utils/precisionFunctions/index.ts Alteração no tratamento de erros de throw new Error para console.error.

Sequence Diagram(s)

Silenciosamente ignorado, pois as mudanças são simples e variadas.

Poem

🐰 Na terra do código, mudanças a brilhar,
Cypress chegou e Jest foi passear.
Testes aprimorados na luz do luar,
Estilos refinados, componentes a dançar.
Com data-testid a guiar,
O projeto melhora, podemos comemorar! 🎉


Tip

Early access features: enabled

We are currently testing the following features in early access:

  • OpenAI gpt-4o model for code reviews and chat: OpenAI claims that this model is better at understanding and generating code than the previous models. We seek your feedback over the next few weeks before making it generally available.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.
  • Please join our Discord Community to provide feedback and report issues.
  • OSS projects are currently opted into early access features by default.
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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

@samufacanha2 samufacanha2 marked this pull request as ready for review July 1, 2024 11:38
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

Outside diff range and nitpick comments (5)
src/utils/precisionFunctions/index.ts (3)

Line range hint 47-47: Melhore o tratamento de erros.

Substituir throw new Error por console.error pode ocultar problemas críticos. Considere adicionar um retorno ou outro mecanismo de tratamento de erros.

- console.error(error);
+ console.error(error);
+ throw error; // ou outra lógica de tratamento de erros

Line range hint 36-36: Evite o uso de spread syntax em acumuladores.

O uso de spread syntax em acumuladores pode levar a problemas de desempenho. Considere usar métodos como .splice ou .push.

- ...prev,
+ Object.assign(prev, { [current]: storedPrecisions[current] }),

Line range hint 47-47: Evite o uso de spread syntax em acumuladores.

O uso de spread syntax em acumuladores pode levar a problemas de desempenho. Considere usar métodos como .splice ou .push.

- ...prev,
+ Object.assign(prev, { [current]: newPrecisions[current] }),
src/components/PrePageTooltip/index.tsx (1)

Line range hint 52-52: Use Number.isNaN em vez de isNaN.

O uso de isNaN é inseguro devido à coerção de tipo. Use Number.isNaN para melhor segurança de tipo.

- if (!isNaN(Number(value)) && Number(value) !== 0) {
+ if (!Number.isNaN(Number(value)) && Number(value) !== 0) {
src/components/Table/index.tsx (1)

Line range hint 312-346: Use optional chaining para simplificar o código.

O uso de optional chaining pode simplificar o código e reduzir a complexidade.

- tableRef.current?.offsetWidth &&
- (tableRef.current?.offsetWidth - 32) /
- header.length
+ tableRef.current?.offsetWidth?.(tableRef.current?.offsetWidth - 32) /
+ header.length
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 19ed9ef and cbd003a.

Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing (22)
  • .github/workflows/node.js.yml (2 hunks)
  • cypress.config.ts (1 hunks)
  • cypress/e2e/navigation_overview.cy.ts (1 hunks)
  • cypress/e2e/pages/accounts.cy.ts (1 hunks)
  • cypress/e2e/pages/transactions.cy.ts (1 hunks)
  • cypress/e2e/pages/validators.cy.ts (1 hunks)
  • cypress/e2e/search_bar.cy.ts (1 hunks)
  • package.json (2 hunks)
  • src/components/Form/EncodingConverter/styles.ts (1 hunks)
  • src/components/InputGlobal/index.tsx (1 hunks)
  • src/components/MultsignComponent/styles.ts (1 hunks)
  • src/components/PrePageTooltip/index.tsx (7 hunks)
  • src/components/PrePageTooltip/styles.tsx (1 hunks)
  • src/components/Table/index.tsx (1 hunks)
  • src/components/Tabs/index.tsx (1 hunks)
  • src/components/TransactionForms/styles.ts (1 hunks)
  • src/contexts/contractModal/styles.ts (1 hunks)
  • src/contexts/inputSearch/index.tsx (2 hunks)
  • src/pages/account/[account].tsx (2 hunks)
  • src/pages/validator/[hash].tsx (1 hunks)
  • src/utils/precisionFunctions/index.ts (1 hunks)
  • tsconfig.json (1 hunks)
Files not reviewed due to errors (1)
  • src/pages/account/[account].tsx (no review received)
Files skipped from review due to trivial changes (8)
  • cypress.config.ts
  • cypress/e2e/navigation_overview.cy.ts
  • cypress/e2e/pages/accounts.cy.ts
  • cypress/e2e/pages/validators.cy.ts
  • src/components/InputGlobal/index.tsx
  • src/components/PrePageTooltip/styles.tsx
  • src/components/TransactionForms/styles.ts
  • tsconfig.json
Additional context used
Biome
src/utils/precisionFunctions/index.ts

[error] 36-36: Avoid the use of spread (...) syntax on accumulators.

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

(lint/performance/noAccumulatingSpread)


[error] 47-47: Avoid the use of spread (...) syntax on accumulators.

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

(lint/performance/noAccumulatingSpread)

src/components/PrePageTooltip/index.tsx

[error] 52-52: isNaN is unsafe. It attempts a type coercion. Use Number.isNaN instead.

See the MDN documentation for more details.
Unsafe fix: Use Number.isNaN instead.

(lint/suspicious/noGlobalIsNan)

src/components/Table/index.tsx

[error] 312-346: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

src/pages/validator/[hash].tsx

[error] 170-174: This else clause can be omitted because previous branches break early.

Unsafe fix: Omit the else clause.

(lint/style/noUselessElse)


[error] 172-174: This else clause can be omitted because previous branches break early.

(lint/style/noUselessElse)

src/pages/account/[account].tsx

[error] 267-267: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


[error] 341-341: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


[error] 342-342: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)


[error] 414-418: This else clause can be omitted because previous branches break early.

Unsafe fix: Omit the else clause.

(lint/style/noUselessElse)


[error] 416-418: This else clause can be omitted because previous branches break early.

(lint/style/noUselessElse)


[error] 425-425: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 428-428: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 431-431: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 435-435: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

Additional comments not posted (23)
src/contexts/inputSearch/index.tsx (2)

6-6: Renomeação da função para setSearchValue está correta.

A renomeação de setLinkValue para setSearchValue melhora a clareza e a consistência do código.


18-18: Atualização do objeto values está correta.

A atualização do objeto values para usar setSearchValue está correta e consistente com a interface ISearch.

.github/workflows/node.js.yml (6)

16-17: Adicionar etapa para definir o fuso horário.

Adicionar a etapa para definir o fuso horário é uma boa prática para garantir que os testes sejam executados no fuso horário correto.


21-22: Adicionar etapa para fazer checkout do código.

Adicionar a etapa para fazer checkout do código é necessário para garantir que o código mais recente seja usado nos testes.


24-31: Configuração do Node.js está correta.

A configuração do Node.js com a versão especificada e o cache do Yarn está correta e segue as melhores práticas.


32-33: Instalação das dependências está correta.

A instalação das dependências com yarn install --frozen-lockfile garante a consistência do ambiente de desenvolvimento.


35-36: Construção do projeto está correta.

A etapa de construção do projeto com yarn build é necessária para preparar o ambiente para os testes.


38-41: Adicionar etapa para executar Cypress.

Adicionar a etapa para executar os testes do Cypress garante que os testes end-to-end sejam executados no pipeline de CI.

cypress/e2e/search_bar.cy.ts (4)

1-1: Adicionar referência do Cypress.

Adicionar a referência do Cypress garante que os tipos do Cypress sejam reconhecidos no arquivo de teste.


3-15: Teste de busca por ativo está correto.

O teste de busca por ativo verifica se a busca por "KLV" funciona corretamente e se a URL é atualizada adequadamente.


17-27: Teste de busca por bloco está correto.

O teste de busca por bloco verifica se a busca por "100" funciona corretamente e se a URL é atualizada adequadamente.


29-45: Teste de busca por endereço está correto.

O teste de busca por endereço verifica se a busca por um endereço específico funciona corretamente e se a URL é atualizada adequadamente.

src/contexts/contractModal/styles.ts (1)

37-37: Atualização do CSS para ButtonModal está correta.

A atualização do CSS para usar &:active em vez de :active é necessária para garantir a aplicação correta do estilo.

cypress/e2e/pages/transactions.cy.ts (2)

1-39: LGTM!

Os testes cobrem a funcionalidade básica e o filtro de transações. O uso do array transaction_links para armazenar links para testes adicionais é uma boa prática.


41-51: LGTM!

Os testes garantem que a página de detalhes da transação seja carregada corretamente para cada tipo de transação armazenada em transaction_links.

src/components/Tabs/index.tsx (2)

46-50: LGTM!

A adição dos atributos data-testid melhora a testabilidade. A lógica do componente permanece inalterada e correta.


58-58: LGTM!

A adição do atributo data-testid melhora a testabilidade.

src/components/Form/EncodingConverter/styles.ts (1)

65-65: LGTM!

A atualização do seletor CSS de :active para &:active está de acordo com a sintaxe do styled-components, garantindo que os estilos do estado ativo sejam aplicados corretamente.

package.json (3)

11-12: LGTM!

A adição dos scripts do Cypress é necessária para executar os testes do Cypress.


69-69: LGTM!

A adição dos tipos do Cypress é necessária para o suporte do TypeScript nos testes do Cypress.


97-98: LGTM!

A adição de uma resolução para o pacote jackspeak garante compatibilidade e previne conflitos de dependência.

src/components/MultsignComponent/styles.ts (1)

121-121: A mudança está correta.

A mudança de :visited para &:visited melhora a especificidade do styled-component.

src/pages/validator/[hash].tsx (1)

336-336: Atributo data-testid adicionado para teste

A adição do atributo data-testid="total-stake" está correta e auxilia nos testes.

@@ -68,7 +68,7 @@ export async function getPrecision(
const newPrecisions = { ...storedPrecisions, ...precisions };
localStorage.setItem('precisions', JSON.stringify(newPrecisions));
if (precisions[assetId] === undefined) {
throw new Error(`This asset does not exist - ${assetId}`);
console.error(`Asset not found - ${assetId}`);
Copy link

Choose a reason for hiding this comment

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

Melhore o tratamento de erros.

Substituir throw new Error por console.error pode ocultar problemas críticos. Considere adicionar um retorno ou outro mecanismo de tratamento de erros.

- console.error(`Asset not found - ${assetId}`);
+ console.error(`Asset not found - ${assetId}`);
+ return null; // ou outra lógica de tratamento de erros
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
console.error(`Asset not found - ${assetId}`);
console.error(`Asset not found - ${assetId}`);
return null; // ou outra lógica de tratamento de erros

coderabbitai[bot]
coderabbitai bot previously requested changes Jul 1, 2024
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: 5

Outside diff range and nitpick comments (2)
src/utils/precisionFunctions/index.ts (2)

Line range hint 36-36: Evite o uso do operador spread em acumuladores.

O uso do operador spread (...) em acumuladores dentro de .reduce causa uma complexidade de tempo O(n^2). Considere usar métodos como .splice ou .push em vez disso.

-      return assetIds.reduce((prev, current) => {
-        return {
-          ...prev,
-          [current]: storedPrecisions[current],
-        };
-      }, {});
+      const result = {};
+      assetIds.forEach((current) => {
+        result[current] = storedPrecisions[current];
+      });
+      return result;
Tools
Biome

[error] 55-55: Avoid the use of spread (...) syntax on accumulators.

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

(lint/performance/noAccumulatingSpread)


Line range hint 47-47: Evite o uso do operador spread em acumuladores.

O uso do operador spread (...) em acumuladores dentro de .reduce causa uma complexidade de tempo O(n^2). Considere usar métodos como .splice ou .push em vez disso.

-      return assetIds.reduce((prev, current) => {
-        return {
-          ...prev,
-          [current]: newPrecisions[current],
-        };
-      }, {});
+      const result = {};
+      assetIds.forEach((current) => {
+        result[current] = newPrecisions[current];
+      });
+      return result;
Tools
Biome

[error] 55-55: Avoid the use of spread (...) syntax on accumulators.

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

(lint/performance/noAccumulatingSpread)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between cbd003a and fec6917.

Files selected for processing (1)
  • src/utils/precisionFunctions/index.ts (2 hunks)
Additional context used
Biome
src/utils/precisionFunctions/index.ts

[error] 36-36: Avoid the use of spread (...) syntax on accumulators.

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

(lint/performance/noAccumulatingSpread)


[error] 47-47: Avoid the use of spread (...) syntax on accumulators.

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

(lint/performance/noAccumulatingSpread)


[error] 55-55: Avoid the use of spread (...) syntax on accumulators.

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

(lint/performance/noAccumulatingSpread)

Additional comments not posted (4)
src/utils/precisionFunctions/index.ts (4)

Line range hint 98-111: LGTM!

O tratamento de erros nesta função está apropriado.

Tools
Biome

[error] 55-55: Avoid the use of spread (...) syntax on accumulators.

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

(lint/performance/noAccumulatingSpread)


Line range hint 116-126: LGTM!

A função é simples e não apresenta problemas.

Tools
Biome

[error] 55-55: Avoid the use of spread (...) syntax on accumulators.

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

(lint/performance/noAccumulatingSpread)


Line range hint 128-144: LGTM!

A função é simples e não apresenta problemas.

Tools
Biome

[error] 55-55: Avoid the use of spread (...) syntax on accumulators.

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

(lint/performance/noAccumulatingSpread)


53-58: Melhore o tratamento de erros.

Substituir throw new Error por console.error pode ocultar problemas críticos. Considere adicionar um retorno ou outro mecanismo de tratamento de erros.

      console.error(error);
      return Object.keys(assetIds).reduce((prev, current) => {
        return {
          ...prev,
          [current]: 0,
        };
      }, {});
+     // Ou outra lógica de tratamento de erros

Likely invalid or redundant comment.

Tools
Biome

[error] 55-55: Avoid the use of spread (...) syntax on accumulators.

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

(lint/performance/noAccumulatingSpread)

Comment on lines +77 to +78
console.error(`Asset not found - ${assetId}`);
return 0;
Copy link

Choose a reason for hiding this comment

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

Melhore o tratamento de erros.

Substituir throw new Error por console.error pode ocultar problemas críticos. Considere adicionar um retorno ou outro mecanismo de tratamento de erros.

          console.error(`Asset not found - ${assetId}`);
          return 0;
+         // Ou outra lógica de tratamento de erros
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
console.error(`Asset not found - ${assetId}`);
return 0;
console.error(`Asset not found - ${assetId}`);
return 0;
// Ou outra lógica de tratamento de erros

Comment on lines +82 to +83
console.error(error);
return 0;
Copy link

Choose a reason for hiding this comment

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

Melhore o tratamento de erros.

Substituir throw new Error por console.error pode ocultar problemas críticos. Considere adicionar um retorno ou outro mecanismo de tratamento de erros.

        console.error(error);
        return 0;
+       // Ou outra lógica de tratamento de erros

Committable suggestion was skipped due to low confidence.

throw new Error(error);
return Object.keys(assetIds).reduce((prev, current) => {
return {
...prev,
Copy link

Choose a reason for hiding this comment

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

Evite o uso do operador spread em acumuladores.

O uso do operador spread (...) em acumuladores dentro de .reduce causa uma complexidade de tempo O(n^2). Considere usar métodos como .splice ou .push em vez disso.

-        return {
-          ...prev,
-          [current]: 0,
-        };
+        prev[current] = 0;
+        return prev;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
...prev,
prev[current] = 0;
return prev;
Tools
Biome

[error] 55-55: Avoid the use of spread (...) syntax on accumulators.

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

(lint/performance/noAccumulatingSpread)

Comment on lines +89 to +90
console.error('Invalid assetId');
return 0;
Copy link

Choose a reason for hiding this comment

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

Melhore o tratamento de erros.

Substituir throw new Error por console.error pode ocultar problemas críticos. Considere adicionar um retorno ou outro mecanismo de tratamento de erros.

    console.error('Invalid assetId');
    return 0;
+   // Ou outra lógica de tratamento de erros

Committable suggestion was skipped due to low confidence.

Comment on lines +64 to +65
console.error('Empty Asset ID');
return 0;
Copy link

Choose a reason for hiding this comment

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

Melhore o tratamento de erros.

Substituir throw new Error por console.error pode ocultar problemas críticos. Considere adicionar um retorno ou outro mecanismo de tratamento de erros.

      console.error('Empty Asset ID');
      return 0;
+     // Ou outra lógica de tratamento de erros

Committable suggestion was skipped due to low confidence.

@samufacanha2 samufacanha2 merged commit 945c531 into develop Jul 1, 2024
1 check failed
@samufacanha2 samufacanha2 deleted the feat/cypress branch July 1, 2024 13:45
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.

2 participants