Skip to content

Commit 23c3771

Browse files
committed
Fix test
1 parent 56ffd44 commit 23c3771

37 files changed

+107
-101
lines changed

.eslintrc.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ module.exports = {
5656
},
5757
// Vitest linting for test files
5858
{
59-
files: 'tests/*.ts',
60-
plugins: ['@vitest'],
61-
extends: ['plugin:@vitest/legacy-recommended', 'prettier'],
59+
files: "tests/*.ts",
60+
plugins: ["@vitest"],
61+
extends: ["plugin:@vitest/legacy-recommended", "prettier"],
6262
// @TODO: Remove all of these rules and adapt code!
6363
rules: {
64-
'@vitest/expect-expect': 'off',
65-
'@vitest/valid-title': 'off',
66-
'@vitest/valid-expect': 'off',
64+
"@vitest/expect-expect": "off",
65+
"@vitest/valid-title": "off",
66+
"@vitest/valid-expect": "off",
6767
},
6868
},
6969
],

tests/client.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { afterAll, expect, test, describe, beforeEach } from 'vitest';
2-
import { ErrorStatusCode, Health, Version, Stats, TaskTypes } from '../src';
3-
import { PACKAGE_VERSION } from '../src/package-version';
1+
import { afterAll, expect, test, describe, beforeEach } from "vitest";
2+
import { ErrorStatusCode, Health, Version, Stats, TaskTypes } from "../src";
3+
import { PACKAGE_VERSION } from "../src/package-version";
44
import {
55
clearAllIndexes,
66
getKey,

tests/dictionary.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { afterAll, expect, test, describe, beforeEach } from 'vitest';
2-
import { EnqueuedTask } from '../src/enqueued-task';
1+
import { afterAll, expect, test, describe, beforeEach } from "vitest";
2+
import { EnqueuedTask } from "../src/enqueued-task";
33
import {
44
clearAllIndexes,
55
config,

tests/displayed_attributes.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { afterAll, expect, test, describe, beforeEach } from 'vitest';
2-
import { ErrorStatusCode } from '../src/types';
1+
import { afterAll, expect, test, describe, beforeEach } from "vitest";
2+
import { ErrorStatusCode } from "../src/types";
33
import {
44
clearAllIndexes,
55
config,

tests/distinct_attribute.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { afterAll, expect, test, describe, beforeEach } from 'vitest';
2-
import { ErrorStatusCode } from '../src/types';
1+
import { afterAll, expect, test, describe, beforeEach } from "vitest";
2+
import { ErrorStatusCode } from "../src/types";
33
import {
44
clearAllIndexes,
55
config,

tests/documents.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { afterAll, expect, test, describe, beforeEach } from 'vitest';
2-
import { ErrorStatusCode, TaskStatus, TaskTypes } from '../src/types';
1+
import { afterAll, expect, test, describe, beforeEach } from "vitest";
2+
import { ErrorStatusCode, TaskStatus, TaskTypes } from "../src/types";
33
import {
44
clearAllIndexes,
55
config,
@@ -169,7 +169,7 @@ describe("Documents tests", () => {
169169
await client.index(indexPk.uid).getDocuments({ filter: "" });
170170

171171
throw new Error(
172-
'getDocuments should have raised an error when the route does not exist',
172+
"getDocuments should have raised an error when the route does not exist",
173173
);
174174
} catch (e: any) {
175175
expect(e.message).toEqual(
@@ -186,7 +186,7 @@ describe("Documents tests", () => {
186186
await client.index(indexPk.uid).getDocuments({ filter: "id = 1" });
187187

188188
throw new Error(
189-
'getDocuments should have raised an error when the filter is badly formatted',
189+
"getDocuments should have raised an error when the filter is badly formatted",
190190
);
191191
} catch (e: any) {
192192
expect(e.message).toEqual(
@@ -660,7 +660,7 @@ Hint: It might not be working because maybe you're not up to date with the Meili
660660
await client.index(indexPk.uid).deleteDocuments({ filter: "" });
661661

662662
throw new Error(
663-
'deleteDocuments should have raised an error when the parameters are wrong',
663+
"deleteDocuments should have raised an error when the parameters are wrong",
664664
);
665665
} catch (e: any) {
666666
expect(e.message).toEqual(
@@ -677,7 +677,7 @@ Hint: It might not be working because maybe you're not up to date with the Meili
677677
await client.index(indexPk.uid).deleteDocuments({ filter: "id = 1" });
678678

679679
throw new Error(
680-
'deleteDocuments should have raised an error when the route does not exist',
680+
"deleteDocuments should have raised an error when the route does not exist",
681681
);
682682
} catch (e: any) {
683683
expect(e.message).toEqual(

tests/dump.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { expect, test, describe, beforeEach } from 'vitest';
2-
import { ErrorStatusCode } from '../src/types';
1+
import { expect, test, describe, beforeEach } from "vitest";
2+
import { ErrorStatusCode } from "../src/types";
33
import {
44
clearAllIndexes,
55
config,

tests/embedders.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { afterAll, expect, test, describe, beforeEach } from 'vitest';
2-
import { EnqueuedTask } from '../src/enqueued-task';
3-
import { Embedders } from '../src/types';
1+
import { afterAll, expect, test, describe, beforeEach } from "vitest";
2+
import { EnqueuedTask } from "../src/enqueued-task";
3+
import { Embedders } from "../src/types";
44
import {
55
clearAllIndexes,
66
config,

tests/errors.test.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
import { expect, test, describe, beforeEach, vi } from 'vitest';
2-
import { MeiliSearch } from './utils/meilisearch-test-utils';
1+
import { expect, test, describe, beforeEach, vi } from "vitest";
2+
import { MeiliSearch } from "./utils/meilisearch-test-utils";
33
import {
44
MeiliSearchError,
55
MeiliSearchApiError,
66
MeiliSearchRequestError,
77
MeiliSearchTimeOutError,
8-
} from '../src/errors';
8+
} from "../src/errors";
99

1010
const mockedFetch = vi.fn();
1111
globalThis.fetch = mockedFetch;
1212

13-
describe('Test on updates', () => {
13+
describe("Test on updates", () => {
1414
beforeEach(() => {
1515
mockedFetch.mockReset();
1616
});
1717

1818
test(`Throw MeilisearchRequestError when throwned error is not MeiliSearchApiError`, async () => {
19-
mockedFetch.mockRejectedValue(new Error('fake error message'));
19+
mockedFetch.mockRejectedValue(new Error("fake error message"));
2020

21-
const client = new MeiliSearch({ host: 'http://localhost:9345' });
21+
const client = new MeiliSearch({ host: "http://localhost:9345" });
2222
try {
2323
await client.health();
2424
} catch (error) {
25-
expect(error.name).toEqual('MeiliSearchRequestError');
25+
expect(error.name).toEqual("MeiliSearchRequestError");
2626
}
2727
});
2828

@@ -37,26 +37,26 @@ describe('Test on updates', () => {
3737
).toEqual(true);
3838
});
3939

40-
test('MeilisearchRequestError can be compared with the instanceof operator', async () => {
41-
mockedFetch.mockRejectedValue(new Error('fake error message'));
40+
test("MeilisearchRequestError can be compared with the instanceof operator", async () => {
41+
mockedFetch.mockRejectedValue(new Error("fake error message"));
4242

43-
const client = new MeiliSearch({ host: 'http://localhost:9345' });
43+
const client = new MeiliSearch({ host: "http://localhost:9345" });
4444
try {
4545
await client.health();
4646
} catch (error) {
4747
expect(error instanceof MeiliSearchRequestError).toEqual(true);
4848
}
4949
});
5050

51-
test('MeiliSearchError can be compared with the instanceof operator', () => {
52-
expect(new MeiliSearchError('message') instanceof MeiliSearchError).toEqual(
51+
test("MeiliSearchError can be compared with the instanceof operator", () => {
52+
expect(new MeiliSearchError("message") instanceof MeiliSearchError).toEqual(
5353
true,
5454
);
5555
});
5656

57-
test('MeiliSearchTimeOutError can be compared with the instanceof operator', () => {
57+
test("MeiliSearchTimeOutError can be compared with the instanceof operator", () => {
5858
expect(
59-
new MeiliSearchTimeOutError('message') instanceof MeiliSearchTimeOutError,
59+
new MeiliSearchTimeOutError("message") instanceof MeiliSearchTimeOutError,
6060
).toEqual(true);
6161
});
6262
});

tests/facet_search.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { expect, test, describe, beforeAll, afterAll } from 'vitest';
1+
import { expect, test, describe, beforeAll, afterAll } from "vitest";
22
import {
33
clearAllIndexes,
44
config,

0 commit comments

Comments
 (0)