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

Vitest not able to mock OidcProvider #1510

Open
Fraulk opened this issue Feb 3, 2025 · 2 comments
Open

Vitest not able to mock OidcProvider #1510

Fraulk opened this issue Feb 3, 2025 · 2 comments

Comments

@Fraulk
Copy link

Fraulk commented Feb 3, 2025

Hello, I replaced an oidc package with your project and it works perfectly, but it broke my test because of this error:

Error: [vitest] No "OidcProvider" export is defined on the "@axa-fr/react-oidc" mock. Did you forget to return it from "vi.mock"?
If you need to partially mock a module, you can use "importOriginal" helper inside:

I also saw that issue #1343 and tried the mock the author did, but it now gives me another error:

TypeError: Cannot read properties of undefined (reading 'match')
@Fraulk
Copy link
Author

Fraulk commented Feb 5, 2025

In the end, I just removed the OidcProvider so my tests can run

@guillaume-chervet
Copy link
Contributor

hi @Fraulk , for the moment i did not find a solution. I set up oidc component in higher component that I does not know how to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants