Skip to content

Commit d09ebfa

Browse files
committed
coverage
1 parent 8c94acc commit d09ebfa

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

test/utils/Base58.test.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,20 @@ describe('Base58', function () {
1414

1515
describe('base58', function () {
1616
describe('encode/decode', function () {
17-
for (const length of [0, 1, 2, 3, 4, 32, 42, 128, 384]) // 512 runs out of gas
18-
it(`buffer of length ${length}`, async function () {
19-
const buffer = ethers.randomBytes(length);
20-
const hex = ethers.hexlify(buffer);
21-
const b58 = ethers.encodeBase58(buffer);
17+
// length 512 runs out of gas.
18+
// this checks are very slow when running coverage, causing CI to timeout.
19+
for (const length of [0, 1, 2, 3, 4, 32, 42, 128, 384])
20+
it(
21+
[length > 32 && '[skip-on-coverage]', `buffer of length ${length}`].filter(Boolean).join(' '),
22+
async function () {
23+
const buffer = ethers.randomBytes(length);
24+
const hex = ethers.hexlify(buffer);
25+
const b58 = ethers.encodeBase58(buffer);
2226

23-
await expect(this.mock.$encode(hex)).to.eventually.equal(b58);
24-
await expect(this.mock.$decode(b58)).to.eventually.equal(hex);
25-
});
27+
await expect(this.mock.$encode(hex)).to.eventually.equal(b58);
28+
await expect(this.mock.$decode(b58)).to.eventually.equal(hex);
29+
},
30+
);
2631
});
2732

2833
describe('decode invalid format', function () {

0 commit comments

Comments
 (0)