Eliminate console error when running test#1179
Merged
Conversation
The network client test "queues requests while a previous identical call is still pending..." was emitting a console error due to an unmocked block tracker network call. That call is now mocked, eliminating the error. I am unsure why the second call is made during this test, but we suspect that it's because the first block tracker call isn't being cached until after the RPC call that triggered it has been resolved. To reproduce, use `.only` on that test and run this command: `yarn workspace @metamask/network-controller jest --coverage=false --verbose=false` Before this change, that command should produce console errors. After this change, there will be none (though there are still lots of warnings). This relates to #1178
f4b86aa to
5bb68f8
Compare
Gudahtt
commented
Apr 13, 2023
|
|
||
| for (const paramIndex of [...Array(numberOfParameters).keys()]) { | ||
| it(`does not reuse the result of a previous request if parameter at index "${paramIndex}" differs`, async () => {// eslint-disable-line | ||
| it(`does not reuse the result of a previous request if parameter at index "${paramIndex}" differs`, async () => { |
Member
Author
There was a problem hiding this comment.
My editor removed this when I formatted the document. I'm not sure why it was there in the first place, but it appears to have been unnecessary.
Member
Author
|
I found one more error in the equivalent test for methods that do have a block param. I have verified locally that these are the only unmocked network calls in the network controller tests. |
5 tasks
Merged
MajorLift
pushed a commit
that referenced
this pull request
Oct 11, 2023
* Eliminate console error when running test The network client test "queues requests while a previous identical call is still pending..." was emitting a console error due to an unmocked block tracker network call. That call is now mocked, eliminating the error. I am unsure why the second call is made during this test, but we suspect that it's because the first block tracker call isn't being cached until after the RPC call that triggered it has been resolved. To reproduce, use `.only` on that test and run this command: `yarn workspace @metamask/network-controller jest --coverage=false --verbose=false` Before this change, that command should produce console errors. After this change, there will be none (though there are still lots of warnings). This relates to #1178 * Eliminate error in second test
MajorLift
pushed a commit
that referenced
this pull request
Oct 11, 2023
* Eliminate console error when running test The network client test "queues requests while a previous identical call is still pending..." was emitting a console error due to an unmocked block tracker network call. That call is now mocked, eliminating the error. I am unsure why the second call is made during this test, but we suspect that it's because the first block tracker call isn't being cached until after the RPC call that triggered it has been resolved. To reproduce, use `.only` on that test and run this command: `yarn workspace @metamask/network-controller jest --coverage=false --verbose=false` Before this change, that command should produce console errors. After this change, there will be none (though there are still lots of warnings). This relates to #1178 * Eliminate error in second test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The network client test "queues requests while a previous identical call is still pending..." was emitting a console error due to an unmocked block tracker network call.
That call is now mocked, eliminating the error.
I am unsure why the second call is made during this test, but we suspect that it's because the first block tracker call isn't being cached until after the RPC call that triggered it has been resolved.
To reproduce, use
.onlyon that test and run this command:yarn workspace @metamask/network-controller jest --coverage=false --verbose=falseBefore this change, that command should produce console errors. After this change, there will be none (though there are still lots of warnings).
Changes
N/A
References
This relates to #1178
Checklist