Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add override function to empty response mocks #1484

Conversation

karlismelderis-mckinsey
Copy link
Contributor

@karlismelderis-mckinsey karlismelderis-mckinsey commented Jun 26, 2024

Status

READY

Description

In some cases we do want to assert received request even for empty response mock
for that UI tests can add assertions in MSW mock override function

this PR allows us to do such assertion even for empty response mock:

      server.use(
        getPetsControllerBulkUpdateMockHandler(
          async ({ request, params }) => {
            const body = await request.json();

            expect(params.id).toBe('2');

            expect(body).toEqual({
              cats: [],
            });
          },
        ),
      );

@melloware melloware added the mock Related to mock generation label Jun 26, 2024
@melloware melloware added this to the 6.32.0 milestone Jun 26, 2024
@melloware melloware merged commit e038704 into orval-labs:master Jun 26, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mock Related to mock generation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants