msw#ResponseResolver TypeScript Examples

The following examples show how to use msw#ResponseResolver. 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 vote down vote up
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 vote down vote up
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 vote down vote up
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 vote down vote up
mockGetCohorts = (
    handler: ResponseResolver<RestRequest<GetCohortsRequest, any>, RestContext, GetCohortsResponse>
) => rest.get<GetCohortsRequest, GetCohortsResponse>('/api/projects/1/cohorts/', handler)