-
Notifications
You must be signed in to change notification settings - Fork 246
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
feat(backend): vitest #4296
base: main
Are you sure you want to change the base?
feat(backend): vitest #4296
Conversation
|
d33a518
to
c70d74d
Compare
@@ -88,7 +88,7 @@ export function buildRequest(options: BuildRequestOptions) { | |||
let res: Response | undefined; | |||
try { | |||
if (formData) { | |||
res = await runtime.fetch(finalUrl.href, { | |||
res = await (process.env.NODE_ENV === 'test' ? fetch : runtime.fetch)(finalUrl.href, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will need to think about a more ergonomic way of accomplishing this. With the way fetch
is handled in the package, msw
can't intercept requests without it for now
}); | ||
expect(jwk).toMatchObject(mockRsaJwk); | ||
jwk = await loadClerkJWKFromRemote({ | ||
secretKey: 'deadbeef', |
Check failure
Code scanning / CodeQL
Hard-coded credentials Critical test
authorization header
// cache should be cleared, but 5m ttl is still valid | ||
fakeClock.next(); | ||
jwk = await loadClerkJWKFromRemote({ | ||
secretKey: 'deadbeef', |
Check failure
Code scanning / CodeQL
Hard-coded credentials Critical test
Description
Spiking out
vitest
test runner as a replacement forqunit
in@clerk/backend
Related: https://linear.app/clerk/issue/SDKI-694/refactor-clerkbackend-to-use-vitest-instead-of-qunit
Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change