Function expose
Type Parameters
- T
Type of the API to expose
Parameters
- name: string
Name of the API
- api: T
API object
Returns T
Example: In your frontend code:
import { expose } from "@webhare/test-frontend";
const authApi = expose("authApi", { isLoggedIn, login });
export type AuthApi = typeof authApi;See
importExposed to access the exposed API
- T
Expose an API for use by frontend tests in a type-safe way