Skip to content

Upgrading to v6.0.0 remove the toBeInTheDocument interface with vitest #515

Open
@qchuchu

Description

@qchuchu
  • @testing-library/jest-dom version: 6.0.0
  • node version: 18.16
  • npm (or yarn) version: 9.5.1

Relevant code or config:

import '@testing-library/jest-dom/vitest';
import { vitest } from 'vitest';
  await waitFor(() => {
    expect(getByTestId('text-input-error-message')).toBeInTheDocument();
  });

What you did:

Upgraded from v5 to v6

What happened:

image

I don't know why, but upgrading the package to the last version using vitest caused all my "toBeInTheDocument" matchers to be undefined, although I can see them in the type definition of the package.

Reproduction:

TO-DO

Problem description:

  • All my tests are failing because toBeInTheDocument is not defined anymore

Suggested solution:

I guess this is due to an upgrade on the dependency of jest types but I'm not sure. Still digging.

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