jest typescript test fetch
example-service.ts import { OktaAuth } from '@okta/okta-auth-js' export interface FooData { hello: string } export interface FooResult { success: boolean extraInfoForFrontend: string } export async function foo(oktaAuth: OktaAuth, data: FooData): Promise<FooResult> { const accessToken = oktaAuth.getAccessToken() try { const response = await fetch("/foo", { headers: { Authorization: `Bearer ${accessToken}`, }, }) const json = await response.json() return { success: true, extraInfoForFrontend: json.message, } } catch (err) { return { success: false, extraInfoForFrontend: 'Could not get data', } } } example-service....