I'm currently developing a web application using NextJS with Typescript. During my testing phase with Jest+Enzyme, I encountered the following error message:
** Test suite failed to run
TypeScript diagnostics (customize using `[jest-config].globals.ts-jest.diagnostics` option):
__tests__/Quest.spec.tsx:15:27 - error TS2605:
JSX element type 'Quest' is not a constructor function for JSX elements. Type 'Quest' is missing properties like context, setState, forceUpdate, props, and refs from type 'ElementClass'.
**
Included below are excerpts from my Test file and the code being tested:
Quest.spec.tsx (Test file)
import * as React from 'react';
import { mount } from 'enzyme';
import Quest from '../Quest';
describe('Quest page', () => {
it('should render without throwing an error', function () {
const wrapper = mount(<Quest/>);
})
})