Q: Jest test pass but I always get a "Nothing was returned from render" error when running jest coverage Note: I already looked through similar questions; the solutions provided do not solve my problem.
I am getting the following error in my React app:
console.error node_modules/jsdom/lib/jsdom/virtual-console.js:29 <br>
Error: Uncaught [Error: Test(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.]

Here is the relevant code:
// Test.jsx 
import React from 'react';

const Test = () => (<div data-testid="test-id">Hello World</div>);

export default Test;

// Test.test.js
import React from 'react';
import { render } from '@testing-library/react';

import Test from './Test';

describe('test <Test />', () => {
  it('should render Test', () => {
    const { getByTestId } = render(<Test />);
    expect(getByTestId('test-id')).toBeTruthy();
  });
});

When I run the npm script jest --watchAll=false --colors --coverage
I got the error below:
 ● test <Test /> › should render Test

Test(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.

   6 | describe('test <Test />', () => {
   7 |   it('should render Test', () => {
>  8 |     const { getByTestId } = render(<Test />);
     |                             ^
   9 |     expect(getByTestId('test-id')).toBeTruthy();
  10 |   });
  11 | });

  at reconcileChildFibers (node_modules/react-dom/cjs/react-dom.development.js:14348:23)
  at reconcileChildren (node_modules/react-dom/cjs/react-dom.development.js:16762:28)
  at mountIndeterminateComponent (node_modules/react-dom/cjs/react-dom.development.js:17542:5)
  at beginWork (node_modules/react-dom/cjs/react-dom.development.js:18596:16)
  at HTMLUnknownElement.callCallback (node_modules/react-dom/cjs/react-dom.development.js:188:14)
  at innerInvokeEventListeners (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:315:27)
  at invokeEventListeners (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:266:3)
  at HTMLUnknownElementImpl._dispatch (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:212:11)
  at HTMLUnknownElementImpl.dispatchEvent (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:87:17)
  at HTMLUnknownElement.dispatchEvent (node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:144:23)
  at Object.invokeGuardedCallbackDev (node_modules/react-dom/cjs/react-dom.development.js:237:16)
  at invokeGuardedCallback (node_modules/react-dom/cjs/react-dom.development.js:292:31)
  at beginWork$1 (node_modules/react-dom/cjs/react-dom.development.js:23203:7)
  at performUnitOfWork (node_modules/react-dom/cjs/react-dom.development.js:22157:12)
  at workLoopSync (node_modules/react-dom/cjs/react-dom.development.js:22130:22)
  at performSyncWorkOnRoot (node_modules/react-dom/cjs/react-dom.development.js:21756:9)
  at scheduleUpdateOnFiber (node_modules/react-dom/cjs/react-dom.development.js:21188:7)
  at updateContainer (node_modules/react-dom/cjs/react-dom.development.js:24373:3)
  at node_modules/react-dom/cjs/react-dom.development.js:24758:7
  at unbatchedUpdates (node_modules/react-dom/cjs/react-dom.development.js:21903:12)
  at legacyRenderSubtreeIntoContainer (node_modules/react-dom/cjs/react-dom.development.js:24757:5)
  at Object.render (node_modules/react-dom/cjs/react-dom.development.js:24840:10)
  at node_modules/@testing-library/react/dist/pure.js:100:25
  at batchedUpdates$1 (node_modules/react-dom/cjs/react-dom.development.js:21856:12)
  at act (node_modules/react-dom/cjs/react-dom-test-utils.development.js:929:14)
  at render (node_modules/@testing-library/react/dist/pure.js:96:26)
  at Object.it (src/components/Test.test.js:8:29)

My Jest plug dependencies:
"@testing-library/jest-dom": "^5.11.0",
"@testing-library/react": "^10.4.6",
"@testing-library/user-event": "^12.0.11",

