Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nidhi-jha-codes/81a422e3d0cdb744d1d8f575ca94699b to your computer and use it in GitHub Desktop.
Save nidhi-jha-codes/81a422e3d0cdb744d1d8f575ca94699b to your computer and use it in GitHub Desktop.
mockOktaAuth = {
// required for SDK checks
options: {
clientId: 'dummy-client-id',
issuer: 'https://dummy.okta.com/oauth2/default'
},
isAuthenticated: jasmine.createSpy().and.resolveTo(true),
tokenManager: {
getTokensSync: () => ({
accessToken: { accessToken: 'fake-token', expiresAt: now + 60 }
}),
setTokens: jasmine.createSpy()
},
token: {
getWithoutPrompt: jasmine.createSpy().and.resolveTo({
accessToken: { accessToken: 'new-token', expiresAt: now + 120 }
})
} as any,
authStateManager: {
subscribe: jasmine.createSpy()
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment