Overview
I have been having A LOT of problems running basic unit tests with shopify's node app setup: https://github.com/Shopify/shopify-app-template-node
When trying to use the @shopify/react-testing library, with Jest as the runner, I keep getting this TypeError of testUtils.act is not a function.
TextFieldComponent.test.tsx
import { mount } from '@shopify/react-testing';
import TextFieldComponent from "../../components/atoms/TextFieldComponent";
describe("TextFieldComponent", () => {
it("renders TextFieldComponent", () => {
const testId = "text-field";
const value = "test";
const label = "test";
const type = "text";
const autoComplete = "off";
const wrapper = mount( <TextFieldComponent
value={value}
type={type}
autoComplete={autoComplete}
label={label}
/>);
});
});
jest.config.js
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom'
}
The Error: testUtils.act is not a function