-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
common/http: expectOne message could be improved #18013
Comments
Is there any workaround to see the actual request received? |
@priteshacharya Just call |
Verify does not show the request query parameters making mis-matching params very hard to debug. angular/packages/common/http/testing/src/backend.ts Lines 126 to 132 in c2dbc55
A simpler debugging message could just find requests where the urls match and show the different params.
|
… matches Fixes angular#18013 Previously it was hard to debug an `expectOne` if the request had no match, as the error message was: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. This commit adds a bit more info to the error, by listing the actual requests received: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. Requests received are: POST /some-url?query=world.
… matches Fixes angular#18013 Previously it was hard to debug an `expectOne` if the request had no match, as the error message was: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. This commit adds a bit more info to the error, by listing the actual requests received: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. Requests received are: POST /some-url?query=world.
… matches Fixes angular#18013 Previously it was hard to debug an `expectOne` if the request had no match, as the error message was: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. This commit adds a bit more info to the error, by listing the actual requests received: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. Requests received are: POST /some-url?query=world.
… matches Fixes angular#18013 Previously it was hard to debug an `expectOne` if the request had no match, as the error message was: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. This commit adds a bit more info to the error, by listing the actual requests received: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. Requests received are: POST /some-url?query=world.
… matches Fixes angular#18013 Previously it was hard to debug an `expectOne` if the request had no match, as the error message was: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. This commit adds a bit more info to the error, by listing the actual requests received: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. Requests received are: POST /some-url?query=world.
… matches Fixes angular#18013 Previously it was hard to debug an `expectOne` if the request had no match, as the error message was: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. This commit adds a bit more info to the error, by listing the actual requests received: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. Requests received are: POST /some-url?query=world.
… matches Fixes angular#18013 Previously it was hard to debug an `expectOne` if the request had no match, as the error message was: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. This commit adds a bit more info to the error, by listing the actual requests received: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. Requests received are: POST /some-url?query=world.
… matches Fixes angular#18013 Previously it was hard to debug an `expectOne` if the request had no match, as the error message was: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. This commit adds a bit more info to the error, by listing the actual requests received: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. Requests received are: POST /some-url?query=world.
… matches (#27005) Fixes #18013 Previously it was hard to debug an `expectOne` if the request had no match, as the error message was: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. This commit adds a bit more info to the error, by listing the actual requests received: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. Requests received are: POST /some-url?query=world. PR Close #27005
… matches (angular#27005) Fixes angular#18013 Previously it was hard to debug an `expectOne` if the request had no match, as the error message was: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. This commit adds a bit more info to the error, by listing the actual requests received: Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. Requests received are: POST /some-url?query=world. PR Close angular#27005
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a ...
Current behavior
A failed test for an HTTP request gives the following message since #17996:
which is better, but still quite hard to debug as we have no idea what the actual request was.
Expected behavior
An ideal message would be something like:
Please tell us about your environment
The text was updated successfully, but these errors were encountered: