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

Eliminate console errors/warnings when running network controller unit tests #1178

Closed
5 tasks
Gudahtt opened this issue Apr 13, 2023 · 1 comment · Fixed by #1237
Closed
5 tasks

Eliminate console errors/warnings when running network controller unit tests #1178

Gudahtt opened this issue Apr 13, 2023 · 1 comment · Fixed by #1237
Assignees
Labels
bug Something isn't working team-wallet-framework

Comments

@Gudahtt
Copy link
Member

Gudahtt commented Apr 13, 2023

The network controller unit tests emit various console warnings and errors when they are run. We should eliminate all of these problems to improve confidence in our tests, reduce console noise, and to make it easier to review the "replace web3 provider engine" PR.

Definition of Done

  • Whenever applies, any change unit tested, reviewed(approved) and documented(JSDOC at least)
  • We have changelog entries for any related changes
  • Any changed APIs have comprehensive inline documentation
  • Any changed public APIs are well covered by unit tests

Other items

  • If a planning/research ticket, then the plan has been reviewed and approved by at least 1 team members
@Gudahtt Gudahtt added bug Something isn't working team-wallet-framework labels Apr 13, 2023
@Gudahtt Gudahtt self-assigned this Apr 13, 2023
Gudahtt added a commit that referenced this issue Apr 13, 2023
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
Gudahtt added a commit that referenced this issue Apr 13, 2023
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
@Gudahtt
Copy link
Member Author

Gudahtt commented Apr 14, 2023

All console errors are eliminated in #1179. Eliminating the warnings is blocked by #1176

Gudahtt added a commit that referenced this issue Apr 14, 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 issue 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 issue 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working team-wallet-framework
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant