Skip to content

Commit

Permalink
Use toBeFulfilled matcher for more tests
Browse files Browse the repository at this point in the history
The `toBeFulfilled` matcher is now used for any network controller test
where we want to ensure a promise is resolved, but we don't care about
the value.

This is a follow-up to a suggestion made in #1336
  • Loading branch information
Gudahtt committed May 9, 2023
1 parent 9e26a16 commit 262a5f6
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions packages/network-controller/tests/NetworkController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2369,7 +2369,7 @@ describe('NetworkController', () => {
},
});

expect(networkWillChange).toStrictEqual([[]]);
expect(networkWillChange).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -2411,7 +2411,7 @@ describe('NetworkController', () => {
},
});

expect(networkDidChange).toStrictEqual([[]]);
expect(networkDidChange).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -2999,7 +2999,7 @@ describe('NetworkController', () => {
},
});

expect(networkWillChange).toStrictEqual([[]]);
expect(networkWillChange).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -3029,7 +3029,7 @@ describe('NetworkController', () => {
},
});

expect(networkDidChange).toStrictEqual([[]]);
expect(networkDidChange).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -3622,7 +3622,7 @@ function refreshNetworkTests({
},
});

expect(networkWillChange).toStrictEqual([[]]);
expect(networkWillChange).toBeFulfilled();
},
);
});
Expand All @@ -3647,7 +3647,7 @@ function refreshNetworkTests({
},
});

expect(networkDidChange).toStrictEqual([[]]);
expect(networkDidChange).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4151,7 +4151,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([[]]);
expect(payloads).toBeFulfilled();
},
);
});
Expand All @@ -4175,7 +4175,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4232,7 +4232,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([[]]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4262,7 +4262,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4293,7 +4293,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4348,7 +4348,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([[]]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4378,7 +4378,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4431,7 +4431,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4460,7 +4460,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([[]]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4516,7 +4516,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([[]]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4546,7 +4546,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4577,7 +4577,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4632,7 +4632,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([[]]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4662,7 +4662,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4693,7 +4693,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4756,7 +4756,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([[]]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4789,7 +4789,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4823,7 +4823,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4884,7 +4884,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([[]]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4917,7 +4917,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -4976,7 +4976,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -5008,7 +5008,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([[]]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -5069,7 +5069,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([[]]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -5102,7 +5102,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down Expand Up @@ -5136,7 +5136,7 @@ function lookupNetworkTests({
},
});

expect(payloads).toStrictEqual([]);
expect(payloads).toBeFulfilled();
},
);
});
Expand Down

0 comments on commit 262a5f6

Please sign in to comment.