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

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

@Mnigos

Description

@Mnigos

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions