You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the jest unit tests I get the following error:
ReferenceError: React is not defined
Writing the import as the following seems to solve it for me:
import * as TestRenderer from 'react-test-renderer';
import React from 'react';
Also, for many test files that already contained a metal Component import, there is an import for React, but if it didn't have it explicitly before it seems to also need it.
The text was updated successfully, but these errors were encountered:
It seems like React also needs to be imported in the test file for the TestRenderer to work. The setup I am using is:
When running the jest unit tests I get the following error:
Writing the import as the following seems to solve it for me:
Also, for many test files that already contained a metal
Component
import, there is an import for React, but if it didn't have it explicitly before it seems to also need it.The text was updated successfully, but these errors were encountered: