Skip to content

Commit 54a4d36

Browse files
committed
fix async tests
1 parent ba80d62 commit 54a4d36

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/edge-cases.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ describe("edge cases", () => {
2121
});
2222

2323
context("try to decode a map with non-string keys (asynchronous)", () => {
24-
it("throws errors", () => {
24+
it("throws errors", async () => {
2525
const createStream = async function*() {
2626
yield [0x81]; // fixmap size=1
2727
yield encode(null);
2828
yield encode(null);
2929
};
3030

31-
assert.rejects(async () => {
32-
decodeAsync(createStream());
31+
await assert.rejects(async () => {
32+
await decodeAsync(createStream());
3333
}, /The type of key must be string/i);
3434
});
3535
});
@@ -54,13 +54,13 @@ describe("edge cases", () => {
5454
}, RangeError);
5555
});
5656

57-
it("throws errors (asynchronous)", () => {
57+
it("throws errors (asynchronous)", async () => {
5858
const createStream = async function*() {
5959
yield [0x92]; // fixarray size=2
6060
yield encode(null);
6161
};
6262

63-
assert.rejects(async () => {
63+
await assert.rejects(async () => {
6464
await decodeAsync(createStream());
6565
}, RangeError);
6666
});
@@ -76,23 +76,23 @@ describe("edge cases", () => {
7676
}, RangeError);
7777
});
7878

79-
it("throws errors (asynchronous)", () => {
79+
it("throws errors (asynchronous)", async () => {
8080
const createStream = async function*() {
8181
yield [0x90]; // fixarray size=0
8282
yield encode(null);
8383
};
8484

85-
assert.rejects(async () => {
85+
await assert.rejects(async () => {
8686
await decodeAsync(createStream());
8787
}, RangeError);
8888
});
8989

90-
it("throws errors (asynchronous)", () => {
90+
it("throws errors (asynchronous)", async () => {
9191
const createStream = async function*() {
9292
yield [0x90, ...encode(null)]; // fixarray size=0 + nil
9393
};
9494

95-
assert.rejects(async () => {
95+
await assert.rejects(async () => {
9696
await decodeAsync(createStream());
9797
}, RangeError);
9898
});

0 commit comments

Comments
 (0)