msw#RestRequest TypeScript Examples
The following examples show how to use
msw#RestRequest.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TaxonomicFilter.stories.tsx From posthog-foss with MIT License | 6 votes |
mockGetPropertyDefinitions = (
handler: ResponseResolver<
RestRequest<GetPropertyDefinitionsRequest, any>,
RestContext,
GetPropertyDefinitionsResponse
>
) =>
rest.get<GetPropertyDefinitionsRequest, GetPropertyDefinitionsResponse>(
'/api/projects/@current/property_definitions',
handler
)
Example #2
Source File: EventSelect.stories.tsx From posthog-foss with MIT License | 5 votes |
mockGetEventDefinitions = (
handler: ResponseResolver<RestRequest<GetEventDefinitionsRequest, any>, RestContext, GetEventDefinitionsResponse>
) =>
rest.get<GetEventDefinitionsRequest, GetEventDefinitionsResponse>(
'/api/projects/:projectId/event_definitions',
handler
)
Example #3
Source File: TaxonomicFilter.stories.tsx From posthog-foss with MIT License | 5 votes |
mockGetPersonProperties = (
handler: ResponseResolver<RestRequest<GetPersonPropertiesRequest, any>, RestContext, GetPersonPropertiesResponse>
) => rest.get<GetPersonPropertiesRequest, GetPersonPropertiesResponse>('/api/person/properties', handler)
Example #4
Source File: TaxonomicFilter.stories.tsx From posthog-foss with MIT License | 5 votes |
mockGetCohorts = (
handler: ResponseResolver<RestRequest<GetCohortsRequest, any>, RestContext, GetCohortsResponse>
) => rest.get<GetCohortsRequest, GetCohortsResponse>('/api/projects/1/cohorts/', handler)