Skip to content

Commit d3efd11

Browse files
committed
Misc
1 parent a5548d2 commit d3efd11

File tree

5 files changed

+12
-23
lines changed

5 files changed

+12
-23
lines changed

src/types/network.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* {@link https://www.meilisearch.com/docs/reference/api/network#the-remote-object}
33
*
4-
* @see `meilisearch_types::features::Remote` at {@link https://github.com/meilisearch/meilisearch}
4+
* @see `meilisearch_types::features::Remote`
55
*/
66
export type Remote = {
77
url: string;
@@ -11,7 +11,7 @@ export type Remote = {
1111
/**
1212
* {@link https://www.meilisearch.com/docs/reference/api/network#the-network-object}
1313
*
14-
* @see `meilisearch_types::features::Network` at {@link https://github.com/meilisearch/meilisearch}
14+
* @see `meilisearch_types::features::Network`
1515
*/
1616
export type Network = {
1717
self: string | null;

src/types/token.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export type TokenIndexRules = Pick<SearchQuery, "filter">;
88
*
99
* @remarks
1010
* Not well documented.
11-
* @see `meilisearch_auth::SearchRules` at {@link https://github.com/meilisearch/meilisearch}
11+
* @see `meilisearch_auth::SearchRules`
1212
*/
1313
export type TokenSearchRules =
1414
| Record<string, TokenIndexRules | null>

src/types/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ export type Config = {
6767
httpClient?: (...args: Parameters<typeof fetch>) => Promise<unknown>;
6868
/** Timeout in milliseconds for each HTTP request. */
6969
timeout?: number;
70-
/** Options for waiting on tasks. */
7170
defaultWaitOptions?: WaitOptions;
7271
};
7372

tests/search.test.ts

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
assert,
44
HOST,
55
MASTER_KEY,
6-
ObjectKeys,
6+
objectKeys,
77
} from "./utils/meilisearch-test-utils.js";
88
import { type Film, FILMS } from "./utils/test-data/films.js";
99
import type {
@@ -31,7 +31,6 @@ import {
3131
} from "./utils/search.js";
3232

3333
beforeAll(async () => {
34-
// TODO: If this disables the rest of the experimental features, that might be a problem, consider https://vitest.dev/config/#globalsetup
3534
await client.updateExperimentalFeatures({ network: true });
3635
await client.updateNetwork({
3736
self: INDEX_UID,
@@ -56,28 +55,20 @@ beforeAll(async () => {
5655
},
5756
})
5857
.waitTask()
59-
.then(({ status, error }) => {
60-
assert.isNull(error);
61-
assert.strictEqual(status, "succeeded");
58+
.then((task) => {
59+
assert.isTaskSuccessful(task);
6260
});
6361

6462
await index
6563
.addDocuments(FILMS)
6664
.waitTask()
67-
.then(({ status, error }) => {
68-
assert.isNull(error);
69-
assert.strictEqual(status, "succeeded");
65+
.then((task) => {
66+
assert.isTaskSuccessful(task);
7067
});
7168
});
7269

7370
afterAll(async () => {
74-
await index
75-
.delete()
76-
.waitTask()
77-
.then(({ status, error }) => {
78-
assert.isNull(error);
79-
assert.strictEqual(status, "succeeded");
80-
});
71+
await index.delete().waitTask();
8172
await client.updateNetwork({});
8273
});
8374

@@ -296,7 +287,7 @@ describe.concurrent("`showMatchesPosition` param", () => {
296287
);
297288
});
298289

299-
const possibleMatchingStrategies = ObjectKeys<MatchingStrategy>({
290+
const possibleMatchingStrategies = objectKeys<MatchingStrategy>({
300291
last: null,
301292
all: null,
302293
frequency: null,
@@ -324,7 +315,6 @@ describe.concurrent.for(possibleMatchingStrategies)(
324315
},
325316
);
326317

327-
// TODO: Another filter with geo filtering
328318
const filterExpressions: [name: string, filter: FilterExpression][] = [
329319
["string", `release_date < ${Date.parse("1998-01-01")} AND id = 607`],
330320
["array", [[`release_date < ${Date.parse("1998-01-01")}`], ["id = 607"]]],

tests/utils/meilisearch-test-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,12 @@ export type Book = {
256256
author: string;
257257
};
258258

259-
function ObjectKeys<T extends string>(o: { [TKey in T]: null }): T[] {
259+
function objectKeys<T extends string>(o: { [TKey in T]: null }): T[] {
260260
return Object.keys(o) as T[];
261261
}
262262

263263
export {
264-
ObjectKeys,
264+
objectKeys,
265265
clearAllIndexes,
266266
config,
267267
masterClient,

0 commit comments

Comments
 (0)