Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX]: remove toBeInTheDocument error in all test files #35

Open
OlgaYasn opened this issue Nov 22, 2024 · 1 comment
Open

[FIX]: remove toBeInTheDocument error in all test files #35

OlgaYasn opened this issue Nov 22, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@OlgaYasn
Copy link

🐛 Description

All the test files containing toBeInTheDocument() have errors : "La propriété 'toBeInTheDocument' n'existe pas sur le type 'Assertion'"

🔍 Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to VitalityLighthouseReportsCategoryGrouper-test.tsx
  2. Scroll down to the bottom of the page
  3. See error

✅ Expected Behavior

The tests files should not contain any error.

❌ Actual Behavior

An error is present everywhere where "toBeInTheDocument()" is used.

📸 Screenshots

Capture d’écran 2024-11-22 à 09 56 53

💻 Environment

  • OS: [e.g., Windows, macOS, Linux]
  • Browser: [e.g., Chrome, Safari]
  • Version: [e.g., 22]
  • Vitality v6y Version: [e.g., 1.0.0]
@OlgaYasn OlgaYasn added the bug Something isn't working label Nov 22, 2024
@OlgaYasn OlgaYasn changed the title [FIX] [FIX]: remove toBeInTheDocument error in all test files Nov 22, 2024
@OlgaYasn
Copy link
Author

Starting point :
If we add @testing-library/jest-dom just to one of the test files, all the error messages disappear.
If vitest.setup.ts file is opened in IDE, the error messages automatically disappear.

Tried methods :

  • Adding @testing-library/jest-dom/vitest in types array in tsconfig.json file
  • Upgarde @testing-library/jest-dom to the latest version
  • Add @vitest/expect as a new dependency
  • Create .npmrc file with public-hoist-pattern[]=@types/*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant