-
Notifications
You must be signed in to change notification settings - Fork 149
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
How to write Unit Tests with Oidc-client Provider. How to mock it? #1343
Comments
Hi @tobiashochguertel , that's a good question. |
@guillaume-chervet that would be great. I haven't yet found a solution, only partly with
But the
|
I got it working so far with
I changed |
Issue and Steps to Reproduce
I have some pages which need unit tests and those pages are secured with OIDC Provider and so on. Now I don't know how to write the Unit Test to mock the parts and simulate that a user is logged in, and has the roles or not to write a test.
Can someone provide an Example of how to mock the OIDC Provider for Unit testing with vitest or jest?
I use Typescript, React, oidc-client (current version), Vite, vitest and react-testing library.
The text was updated successfully, but these errors were encountered: