Skip to content

Commit 1c1dfbc

Browse files
committed
Improve error tests
1 parent dd4b147 commit 1c1dfbc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/meilisearch.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ describe("errors", () => {
227227

228228
const ms = new MeiliSearch({ host: "https://politi.dk/en/" });
229229
const error = await assert.rejects(ms.health(), MeiliSearchRequestError);
230+
assert.typeOf(error.message, "string");
230231
assert.deepEqual(error.cause, simulatedError);
231232
});
232233

@@ -245,7 +246,9 @@ describe("errors", () => {
245246

246247
const ms = new MeiliSearch({ host: "https://polisen.se/en/" });
247248
const error = await assert.rejects(ms.health(), MeiliSearchApiError);
249+
assert.typeOf(error.message, "string");
248250
assert.deepEqual(error.cause, simulatedCause);
251+
assert.instanceOf(error.response, Response);
249252
});
250253

251254
// MeiliSearchTaskTimeOutError is tested by tasks-and-batches tests

0 commit comments

Comments
 (0)