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

--bail flag does not work for test in referenced request #540

Closed
Nick-Palacio opened this issue Sep 5, 2023 · 3 comments
Closed

--bail flag does not work for test in referenced request #540

Nick-Palacio opened this issue Sep 5, 2023 · 3 comments

Comments

@Nick-Palacio
Copy link

Consider the following files:

  • setupFile.http
     # @name json
    GET https://postman-echo.com/get
    {{
        const assert = require('node:assert/strict');
        test('some test', () => {
            assert.fail('some failure');
        });
    }}
    
  • test.http
    # @import ./setupFile.http
    # @ref json
    # This should never run because json request fails
    POST https://postman-echo.com/post
    
  • test2.http
    POST https://postman-echo.com/post

If I run httpyac send 'test*.http' --all --bail:

  • Expected Behavior:
    • The POST requests in test.http and test2.http are never run because we get an error after @json is run and @json is referenced by test.http
  • Actual Behavior
    • All requests are run and we see in the end that 2 requests succeeded (test.http and test2.http) and 1 failed (setupFile.http)
@AnWeber
Copy link
Owner

AnWeber commented Sep 5, 2023

Yes, seems that you are right. The needed Interceptor is only added to current file and not for all parsed files. I will fix it.

@Nick-Palacio
Copy link
Author

You are the best @AnWeber! Thank you for all your work on this project.

@AnWeber
Copy link
Owner

AnWeber commented Sep 6, 2023

Well, the error you reported was already exactly like that in my VSCode extension. So not quite as good:-) And it is fixed with current release.

But I know how it is meant. thanks. Have fun using it.

@AnWeber AnWeber closed this as completed Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants