Skip to content

Commit 70b5105

Browse files
committed
Ask Claude to fix the last test.
prompt: In the very last test, for "listing, updating, and deleting client", the test is failing because mockEnv.OAUTH_PROVIDER isn't set. I think this is because there were no actual fetches executed in the test so the library didn't get a chance to fill in OAUTH_PROVIDER. Can you fix?
1 parent 66a2e0a commit 70b5105

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

__tests__/oauth-provider.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,13 @@ describe('OAuthProvider', () => {
833833
});
834834

835835
it('should allow listing, updating, and deleting clients', async () => {
836+
// First make a simple request to initialize the OAUTH_PROVIDER in the environment
837+
const initRequest = createMockRequest('https://example.com/');
838+
await oauthProvider.fetch(initRequest, mockEnv, mockCtx);
839+
840+
// Now OAUTH_PROVIDER should be initialized
841+
expect(mockEnv.OAUTH_PROVIDER).not.toBeNull();
842+
836843
// Create a client
837844
const client = await mockEnv.OAUTH_PROVIDER.createClient({
838845
redirectUris: ['https://client.example.com/callback'],

0 commit comments

Comments
 (0)