Skip to content

Commit 91c3fce

Browse files
authored
Merge pull request #38 from julbrs/adjust-vitest-warning
Update request method tests to use async/await for error handling
2 parents d383908 + a61747c commit 91c3fce

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/request.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ describe("Test request method", () => {
126126

127127
it("should reject with meaningful error if bad url", async () => {
128128
expect.assertions(1);
129-
expect(() =>
129+
await expect(() =>
130130
client.request({
131131
path: "record/v1/bad-path",
132132
})
@@ -135,7 +135,7 @@ describe("Test request method", () => {
135135

136136
it("should reject with meaningful error if bad object", async () => {
137137
expect.assertions(1);
138-
expect(() =>
138+
await expect(() =>
139139
client.request({
140140
path: "record/v1/customer/-1",
141141
})
@@ -146,7 +146,7 @@ describe("Test request method", () => {
146146

147147
it("should reject with meaningful error if bad request (wrong body)", async () => {
148148
expect.assertions(1);
149-
expect(() =>
149+
await expect(() =>
150150
client.request({
151151
method: "post",
152152
path: "record/v1/customer",
@@ -157,7 +157,7 @@ describe("Test request method", () => {
157157

158158
it("should reject with meaningful error if bad request (missing fields)", async () => {
159159
expect.assertions(1);
160-
expect(() =>
160+
await expect(() =>
161161
client.request({
162162
method: "post",
163163
path: "record/v1/customer",

0 commit comments

Comments
 (0)