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

fix(common): http/testing expectOne lists the received requests #27005

Closed
wants to merge 3 commits into from

Conversation

cexbrayat
Copy link
Member

@cexbrayat cexbrayat commented Nov 8, 2018

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

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.

Issue Number: #18013

What is the new behavior?

This commit adds a bit more info to the error, by listing the actual requests received, if there are some (doesn't change the message if no requests were received):

 Expected one matching request for criteria "Match URL: /some-url?query=hello", found none. Requests received are: POST /some-url?query=world.

Does this PR introduce a breaking change?

  • Yes
  • No

@ngbot ngbot bot added this to the needsTriage milestone Dec 11, 2018
@cexbrayat cexbrayat requested a review from a team as a code owner January 9, 2019 16:08
@cexbrayat cexbrayat force-pushed the fix/18013-expect-one branch 2 times, most recently from f87c9f4 to 0996ee3 Compare January 10, 2019 10:41
@cexbrayat cexbrayat requested a review from a team as a code owner January 21, 2020 15:42
Copy link
Member

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One NIT but otherwise LGTM.

@petebacondarwin petebacondarwin added area: testing Issues related to Angular testing features, such as TestBed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews action: review The PR is still awaiting reviews from at least one requested reviewer feature Issue that requests a new feature labels Jan 21, 2020
@petebacondarwin petebacondarwin added action: presubmit The PR is in need of a google3 presubmit and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jan 21, 2020
@alxhub
Copy link
Member

alxhub commented Jan 21, 2020

Presubmit

@alxhub
Copy link
Member

alxhub commented Jan 22, 2020

Caretaker: the presubmit errors are legit. 290817196 contains the necessary g3 patches.

@cexbrayat cexbrayat added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Jan 24, 2020
Copy link
Contributor

@IgorMinar IgorMinar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

… 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.
@AndrewKushnir
Copy link
Contributor

FYI, I submitted a change in g3 to adapt some code to upcoming changes from this PR. Once it's merged, I will run another presubmit and remove the "blocked" label if everything goes well. Thank you.

@AndrewKushnir
Copy link
Contributor

New g3 presubmit

@AndrewKushnir AndrewKushnir added risk: medium and removed action: presubmit The PR is in need of a google3 presubmit state: blocked labels Jan 31, 2020
@AndrewKushnir
Copy link
Contributor

FYI, g3 presubmit is now passing (after respective changes in g3), this PR is ready to be merged.

@mhevery mhevery added the target: patch This PR is targeted for the next patch release label Jan 31, 2020
@mhevery mhevery closed this in a622a28 Jan 31, 2020
mhevery pushed a commit that referenced this pull request Jan 31, 2020
… 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
mhevery pushed a commit that referenced this pull request Jan 31, 2020
mhevery pushed a commit that referenced this pull request Jan 31, 2020
… 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
sonukapoor pushed a commit to sonukapoor/angular that referenced this pull request Feb 13, 2020
sonukapoor pushed a commit to sonukapoor/angular that referenced this pull request Feb 13, 2020
… 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
sonukapoor pushed a commit to sonukapoor/angular that referenced this pull request Feb 13, 2020
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: common/http area: testing Issues related to Angular testing features, such as TestBed cla: yes feature Issue that requests a new feature risk: medium target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants