Skip to content

Commit a1a385c

Browse files
authored
fix: tests with async fn in describe (#5086)
1 parent 401aea8 commit a1a385c

34 files changed

+65
-65
lines changed

packages/hardhat-core/test/internal/context.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useEnvironment } from "../helpers/environment";
77
import { expectHardhatError } from "../helpers/errors";
88
import { useFixtureProject } from "../helpers/project";
99

10-
describe("Hardhat context", async function () {
10+
describe("Hardhat context", function () {
1111
describe("no context", () => {
1212
it("context is not defined", async function () {
1313
assert.isFalse(HardhatContext.isCreated());
@@ -21,7 +21,7 @@ describe("Hardhat context", async function () {
2121
});
2222
});
2323

24-
describe("create context but no environment", async function () {
24+
describe("create context but no environment", function () {
2525
afterEach("reset context", function () {
2626
resetHardhatContext();
2727
});
@@ -63,7 +63,7 @@ describe("Hardhat context", async function () {
6363
});
6464
});
6565

66-
describe("environment creates context", async function () {
66+
describe("environment creates context", function () {
6767
useFixtureProject("config-project");
6868
useEnvironment();
6969
it("should create context and set HRE into context", async function () {

packages/hardhat-core/test/internal/core/providers/construction.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { expectHardhatErrorAsync } from "../../../helpers/errors";
2121

2222
import { MockedProvider } from "./mocks";
2323

24-
describe("Network config typeguards", async () => {
24+
describe("Network config typeguards", () => {
2525
it("Should recognize HDAccountsConfig", () => {
2626
assert.isTrue(isHDAccountsConfig({ mnemonic: "asdads" } as any));
2727
assert.isFalse(isHDAccountsConfig({ initialIndex: 1 } as any));

packages/hardhat-core/test/internal/hardhat-network/provider/error-object.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe("error object in JSON-RPC response", function () {
3636
describe(`${name} provider`, function () {
3737
setCWD();
3838

39-
describe("should have the right fields", async function () {
39+
describe("should have the right fields", function () {
4040
useProvider();
4141
useHelpers();
4242

packages/hardhat-core/test/internal/hardhat-network/provider/hardhat-network-options.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ describe("Hardhat Network special options", function () {
171171
});
172172

173173
describe("accounts", function () {
174-
describe("mnemonic without passphrase", async function () {
174+
describe("mnemonic without passphrase", function () {
175175
useFixtureProject("mnemonic-without-passphrase");
176176
useEnvironment();
177177

@@ -189,7 +189,7 @@ describe("Hardhat Network special options", function () {
189189
});
190190
});
191191

192-
describe("mnemonic with a passphrase", async function () {
192+
describe("mnemonic with a passphrase", function () {
193193
useFixtureProject("mnemonic-with-passphrase");
194194
useEnvironment();
195195

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/blockNumber.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe("Eth module", function () {
2626
setCWD();
2727
useProvider();
2828

29-
describe("eth_blockNumber", async function () {
29+
describe("eth_blockNumber", function () {
3030
let firstBlockNumber: number;
3131

3232
beforeEach(async function () {

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/call.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe("Eth module", function () {
5757
setCWD();
5858
useProvider();
5959

60-
describe("eth_call", async function () {
60+
describe("eth_call", function () {
6161
describe("when called without blockTag param", () => {
6262
it("Should return the value returned by the contract", async function () {
6363
const contractAddress = await deployContract(

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/estimateGas.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe("Eth module", function () {
3131
setCWD();
3232
useProvider();
3333

34-
describe("eth_estimateGas", async function () {
34+
describe("eth_estimateGas", function () {
3535
it("should estimate the gas for a transfer", async function () {
3636
const estimation = await this.provider.send("eth_estimateGas", [
3737
{

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/feeHistory.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe("Eth module", function () {
2121
setCWD();
2222
useProvider();
2323

24-
describe("eth_feeHistory", async function () {
24+
describe("eth_feeHistory", function () {
2525
describe("Params validation", function () {
2626
it("Should validate that block count is in [1, 1024]", async function () {
2727
await assertInvalidInputError(

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/gasPrice.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe("Eth module", function () {
1414
describe(`${name} provider`, function () {
1515
setCWD();
1616

17-
describe("eth_gasPrice", async function () {
17+
describe("eth_gasPrice", function () {
1818
describe("with eip-1559", function () {
1919
useProvider();
2020

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/getBalance.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe("Eth module", function () {
3333
setCWD();
3434
useProvider();
3535

36-
describe("eth_getBalance", async function () {
36+
describe("eth_getBalance", function () {
3737
it("Should return 0 for empty accounts", async function () {
3838
if (!isFork) {
3939
assertQuantity(

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/getBlockByHash.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe("Eth module", function () {
2424
setCWD();
2525
useProvider();
2626

27-
describe("eth_getBlockByHash", async function () {
27+
describe("eth_getBlockByHash", function () {
2828
it("should return null for non-existing blocks", async function () {
2929
assert.isNull(
3030
await this.provider.send("eth_getBlockByHash", [

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/getBlockByNumber.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe("Eth module", function () {
2929
setCWD();
3030
useProvider({ hardfork: "london" });
3131

32-
describe("eth_getBlockByNumber", async function () {
32+
describe("eth_getBlockByNumber", function () {
3333
it("Should return the genesis block for number 0", async function () {
3434
const block = await this.provider.send("eth_getBlockByNumber", [
3535
numberToRpcQuantity(0),

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/getBlockTransactionCountByHash.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe("Eth module", function () {
2323
setCWD();
2424
useProvider();
2525

26-
describe("eth_getBlockTransactionCountByHash", async function () {
26+
describe("eth_getBlockTransactionCountByHash", function () {
2727
it("should return null for non-existing blocks", async function () {
2828
assert.isNull(
2929
await this.provider.send("eth_getBlockTransactionCountByHash", [

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/getBlockTransactionCountByNumber.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe("Eth module", function () {
2222
setCWD();
2323
useProvider();
2424

25-
describe("eth_getBlockTransactionCountByNumber", async function () {
25+
describe("eth_getBlockTransactionCountByNumber", function () {
2626
it("should return null for non-existing blocks", async function () {
2727
const firstBlockNumber = rpcQuantityToNumber(
2828
await this.provider.send("eth_blockNumber")

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/getCode.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe("Eth module", function () {
3131
setCWD();
3232
useProvider();
3333

34-
describe("eth_getCode", async function () {
34+
describe("eth_getCode", function () {
3535
it("Should return an empty buffer for non-contract accounts", async function () {
3636
assert.equal(
3737
await this.provider.send("eth_getCode", [zeroAddress()]),

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/getFilterLogs.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe("Eth module", function () {
2525
setCWD();
2626
useProvider();
2727

28-
describe("eth_getFilterLogs", async function () {
28+
describe("eth_getFilterLogs", function () {
2929
let firstBlockNumber: number;
3030

3131
beforeEach(async function () {

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/getLogs.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe("Eth module", function () {
2525
setCWD();
2626
useProvider();
2727

28-
describe("eth_getLogs", async function () {
28+
describe("eth_getLogs", function () {
2929
let firstBlockNumber: number;
3030

3131
beforeEach(async function () {

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/getStorageAt.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe("Eth module", function () {
2828
setCWD();
2929
useProvider();
3030

31-
describe("eth_getStorageAt", async function () {
31+
describe("eth_getStorageAt", function () {
3232
describe("Imitating Ganache", function () {
3333
describe("When a slot has not been written into", function () {
3434
it("Should return `0x0000000000000000000000000000000000000000000000000000000000000000`", async function () {

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/getTransactionByBlockHashAndIndex.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe("Eth module", function () {
4545
setCWD();
4646
useProvider();
4747

48-
describe("eth_getTransactionByBlockHashAndIndex", async function () {
48+
describe("eth_getTransactionByBlockHashAndIndex", function () {
4949
it("should return null for non-existing blocks", async function () {
5050
assert.isNull(
5151
await this.provider.send("eth_getTransactionByBlockHashAndIndex", [

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/getTransactionByBlockNumberAndIndex.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe("Eth module", function () {
4444
setCWD();
4545
useProvider();
4646

47-
describe("eth_getTransactionByBlockNumberAndIndex", async function () {
47+
describe("eth_getTransactionByBlockNumberAndIndex", function () {
4848
it("should return null for non-existing blocks", async function () {
4949
assert.isNull(
5050
await this.provider.send(

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/getTransactionByHash.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe("Eth module", function () {
5656
setCWD();
5757
useProvider();
5858

59-
describe("eth_getTransactionByHash", async function () {
59+
describe("eth_getTransactionByHash", function () {
6060
it("should return null for unknown txs", async function () {
6161
assert.isNull(
6262
await this.provider.send("eth_getTransactionByHash", [

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/getTransactionCount.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe("Eth module", function () {
2929
setCWD();
3030
useProvider();
3131

32-
describe("eth_getTransactionCount", async function () {
32+
describe("eth_getTransactionCount", function () {
3333
it("Should return 0 for random accounts", async function () {
3434
assertQuantity(
3535
await this.provider.send("eth_getTransactionCount", [

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/getTransactionReceipt.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe("Eth module", function () {
4646
setCWD();
4747
useProvider();
4848

49-
describe("eth_getTransactionReceipt", async function () {
49+
describe("eth_getTransactionReceipt", function () {
5050
it("should return null for unknown txs", async function () {
5151
const receipt = await this.provider.send(
5252
"eth_getTransactionReceipt",

packages/hardhat-core/test/internal/hardhat-network/provider/modules/eth/methods/index.ts

+21-21
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@ describe("Eth module", function () {
2828
setCWD();
2929
useProvider();
3030

31-
describe("eth_accounts", async function () {
31+
describe("eth_accounts", function () {
3232
it("should return the genesis accounts in lower case", async function () {
3333
const accounts = await this.provider.send("eth_accounts");
3434

3535
assert.deepEqual(accounts, DEFAULT_ACCOUNTS_ADDRESSES);
3636
});
3737
});
3838

39-
describe("eth_chainId", async function () {
39+
describe("eth_chainId", function () {
4040
it("should return the chain id as QUANTITY", async function () {
4141
assertQuantity(await this.provider.send("eth_chainId"), chainId);
4242
});
4343
});
4444

45-
describe("eth_coinbase", async function () {
45+
describe("eth_coinbase", function () {
4646
it("should return the default coinbase address", async function () {
4747
assert.equal(
4848
await this.provider.send("eth_coinbase"),
@@ -51,37 +51,37 @@ describe("Eth module", function () {
5151
});
5252
});
5353

54-
describe("eth_compileLLL", async function () {
54+
describe("eth_compileLLL", function () {
5555
it("is not supported", async function () {
5656
await assertNotSupported(this.provider, "eth_compileLLL");
5757
});
5858
});
5959

60-
describe("eth_compileSerpent", async function () {
60+
describe("eth_compileSerpent", function () {
6161
it("is not supported", async function () {
6262
await assertNotSupported(this.provider, "eth_compileSerpent");
6363
});
6464
});
6565

66-
describe("eth_compileSolidity", async function () {
66+
describe("eth_compileSolidity", function () {
6767
it("is not supported", async function () {
6868
await assertNotSupported(this.provider, "eth_compileSolidity");
6969
});
7070
});
7171

72-
describe("eth_getCompilers", async function () {
72+
describe("eth_getCompilers", function () {
7373
it("is not supported", async function () {
7474
await assertNotSupported(this.provider, "eth_getCompilers");
7575
});
7676
});
7777

78-
describe("eth_getProof", async function () {
78+
describe("eth_getProof", function () {
7979
it("is not supported", async function () {
8080
await assertNotSupported(this.provider, "eth_getProof");
8181
});
8282
});
8383

84-
describe("eth_getUncleByBlockHashAndIndex", async function () {
84+
describe("eth_getUncleByBlockHashAndIndex", function () {
8585
it("is not supported", async function () {
8686
await assertNotSupported(
8787
this.provider,
@@ -90,7 +90,7 @@ describe("Eth module", function () {
9090
});
9191
});
9292

93-
describe("eth_getUncleByBlockNumberAndIndex", async function () {
93+
describe("eth_getUncleByBlockNumberAndIndex", function () {
9494
it("is not supported", async function () {
9595
await assertNotSupported(
9696
this.provider,
@@ -99,7 +99,7 @@ describe("Eth module", function () {
9999
});
100100
});
101101

102-
describe("eth_getUncleCountByBlockHash", async function () {
102+
describe("eth_getUncleCountByBlockHash", function () {
103103
it("is not supported", async function () {
104104
await assertNotSupported(
105105
this.provider,
@@ -108,7 +108,7 @@ describe("Eth module", function () {
108108
});
109109
});
110110

111-
describe("eth_getUncleCountByBlockNumber", async function () {
111+
describe("eth_getUncleCountByBlockNumber", function () {
112112
it("is not supported", async function () {
113113
await assertNotSupported(
114114
this.provider,
@@ -117,36 +117,36 @@ describe("Eth module", function () {
117117
});
118118
});
119119

120-
describe("eth_getWork", async function () {
120+
describe("eth_getWork", function () {
121121
it("is not supported", async function () {
122122
await assertNotSupported(this.provider, "eth_getWork");
123123
});
124124
});
125125

126-
describe("eth_hashrate", async function () {
126+
describe("eth_hashrate", function () {
127127
it("is not supported", async function () {
128128
await assertNotSupported(this.provider, "eth_hashrate");
129129
});
130130
});
131131

132-
describe("eth_mining", async function () {
132+
describe("eth_mining", function () {
133133
it("should return false", async function () {
134134
assert.deepEqual(await this.provider.send("eth_mining"), false);
135135
});
136136
});
137137

138-
describe("eth_protocolVersion", async function () {
138+
describe("eth_protocolVersion", function () {
139139
it("is not supported", async function () {
140140
await assertNotSupported(this.provider, "eth_protocolVersion");
141141
});
142142
});
143143

144-
describe("eth_sign", async function () {
144+
describe("eth_sign", function () {
145145
// TODO: Test this. Note that it's implementation is tested in one of
146146
// our provider wrappers, but re-test it here anyway.
147147
});
148148

149-
describe("eth_signTransaction", async function () {
149+
describe("eth_signTransaction", function () {
150150
it("is not supported", async function () {
151151
await assertNotSupported(this.provider, "eth_signTransaction");
152152
});
@@ -164,19 +164,19 @@ describe("Eth module", function () {
164164
});
165165
});
166166

167-
describe("eth_submitHashrate", async function () {
167+
describe("eth_submitHashrate", function () {
168168
it("is not supported", async function () {
169169
await assertNotSupported(this.provider, "eth_submitHashrate");
170170
});
171171
});
172172

173-
describe("eth_submitWork", async function () {
173+
describe("eth_submitWork", function () {
174174
it("is not supported", async function () {
175175
await assertNotSupported(this.provider, "eth_submitWork");
176176
});
177177
});
178178

179-
describe("eth_syncing", async function () {
179+
describe("eth_syncing", function () {
180180
it("Should return false", async function () {
181181
assert.deepEqual(await this.provider.send("eth_syncing"), false);
182182
});

0 commit comments

Comments
 (0)