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 unmocked block tracker warning in NetworkController tests #5289

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/network-controller/tests/NetworkController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,12 @@ describe('NetworkController', () => {

it('stops the block tracker for the currently selected network as long as the provider has been initialized', async () => {
await withController(async ({ controller }) => {
const fakeProvider = buildFakeProvider();
const fakeProvider = buildFakeProvider([
{
request: { method: 'eth_blockNumber' },
response: { result: '0x1' },
},
]);
const fakeNetworkClient = buildFakeClient(fakeProvider);
mockCreateNetworkClient().mockReturnValue(fakeNetworkClient);
await controller.initializeProvider();
Expand Down Expand Up @@ -14475,7 +14480,8 @@ function buildFakeClient(
* optionally provided for certain RPC methods.
*
* @param stubs - The list of RPC methods you want to stub along with their
* responses. `eth_getBlockByNumber` will be stubbed by default.
* responses. `eth_getBlockByNumber` and `eth_blockNumber will be stubbed by
* default.
* @returns The object.
*/
function buildFakeProvider(stubs: FakeProviderStub[] = []): Provider {
Expand Down
Loading