Fala pessoal, estou recebendo esse erro aqui quando executo o teste...
FAIL src\App.test.js ● Componente principal › Mostrar o nome do banco
ReferenceError: document is not defined
at render (node_modules/@testing-library/react/dist/pure.js:68:5)
at Object.<anonymous> (src/App.test.js:8:28)
at new Promise (<anonymous>)
at node_modules/p-map/index.js:46:16
at processTicksAndRejections (node:internal/process/task_queues:93:5)
Componente principal × Mostrar o nome do banco (3ms)
Test Suites: 1 failed, 1 total Tests: 1 failed, 1 total FAIL src\App.test.js ● Componente principal › Mostrar o nome do banco
ReferenceError: document is not defined
at render (node_modules/@testing-library/react/dist/pure.js:68:5)
at Object.<anonymous> (src/App.test.js:8:28)
at new Promise (<anonymous>)
at node_modules/p-map/index.js:46:16
at processTicksAndRejections (node:internal/process/task_queues:93:5)
Componente principal × Mostrar o nome do banco (1ms)
Test Suites: 1 failed, 1 total Tests: 1 failed, 1 total Snapshots: 0 total Time: 3.443s, estimated 4s Ran all test suites related to changed files.
Segue abaixo o meu código do arquivo App.test.js
import React from 'react';
import { render, screen } from '@testing-library/react';
import App from './app';
describe('Componente principal', () => {
it('Mostrar o nome do banco', () => {
render(<App />);
expect(screen.getByText('ByteBank')).toBeInTheDocument();
})
})