Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

Error in jest: TypeError: React.forwardRef is not a function #72

Open
Mnigos opened this issue Apr 16, 2022 · 0 comments
Open

Error in jest: TypeError: React.forwardRef is not a function #72

Mnigos opened this issue Apr 16, 2022 · 0 comments

Comments

@Mnigos
Copy link

Mnigos commented Apr 16, 2022

index.spec.tsx

import { render, screen } from '@testing-library/react'

import Home from '.'

describe('Home', () => {
  it('should render component', () => {
    render(<Home />)
    expect(screen.getByText('RIGTCH')).toBeInTheDocument()
  })
})

error message

Test suite failed to run

    TypeError: React.forwardRef is not a function

    > 1 | import { Button } from '@vechaiui/react'
        | ^
      2 |
      3 | export default function Index() {
      4 |   return (

      at Object.<anonymous> (node_modules/@vechaiui/icon/src/core.tsx:5:41)
      at Object.<anonymous> (node_modules/@vechaiui/icon/src/index.ts:1:1)
      at Object.<anonymous> (node_modules/@vechaiui/alert/src/alert.tsx:2:1)
      at Object.<anonymous> (node_modules/@vechaiui/alert/src/index.ts:3:1)
      at Object.<anonymous> (node_modules/@vechaiui/react/src/index.ts:1:1)
      at Object.<anonymous> (app/routes/index.tsx:1:1)
      at Object.<anonymous> (app/routes/index.spec.tsx:3:1)
      at TestScheduler.scheduleTests (node_modules/@jest/core/build/TestScheduler.js:333:13)
      at runJest (node_modules/@jest/core/build/runJest.js:404:19)
      at _run10000 (node_modules/@jest/core/build/cli/index.js:320:7)
      at runCLI (node_modules/@jest/core/build/cli/index.js:173:3)

I also tried to wrap Home component into VechaiProvider and got same result

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
1 participant