Skip to content

Commit

Permalink
formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Strift committed Dec 4, 2024
1 parent 3c2a2b8 commit 33b1386
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/indexes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,6 @@ class Index<T extends Record<string, any> = Record<string, any>> {
const task = await this.httpRequest.delete(url);
return new EnqueuedTask(task);
}

}

export { Index };
4 changes: 3 additions & 1 deletion tests/facet_search_settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ describe.each([{ permission: "Master" }, { permission: "Admin" }])(
test(`${permission} key: Set facetSearch settings with dedicated endpoint on empty index`, async () => {
const client = await getClient(permission);

const { taskUid } = await client.index(index.uid).updateFacetSearch(false);
const { taskUid } = await client
.index(index.uid)
.updateFacetSearch(false);
await client.index(index.uid).waitForTask(taskUid);

const updatedSettings = await client.index(index.uid).getFacetSearch();
Expand Down
12 changes: 7 additions & 5 deletions tests/prefix_search_settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ describe.each([{ permission: "Master" }, { permission: "Admin" }])(
test(`${permission} key: Set prefixSearch settings with dedicated endpoint on empty index`, async () => {
const client = await getClient(permission);

const { taskUid } = await client.index(index.uid).updatePrefixSearch('disabled');
const { taskUid } = await client
.index(index.uid)
.updatePrefixSearch("disabled");
await client.index(index.uid).waitForTask(taskUid);

const updatedSettings = await client.index(index.uid).getPrefixSearch();
expect(updatedSettings).toBe('disabled');
expect(updatedSettings).toBe("disabled");
});

test(`${permission} key: Reset prefixSearch settings on an empty index`, async () => {
Expand Down Expand Up @@ -76,7 +78,7 @@ describe.each([{ permission: "Search" }])(
test(`${permission} key: try to update prefix search settings and be denied`, async () => {
const client = await getClient(permission);
await expect(
client.index(index.uid).updatePrefixSearch('disabled'),
client.index(index.uid).updatePrefixSearch("disabled"),
).rejects.toHaveProperty("cause.code", ErrorStatusCode.INVALID_API_KEY);
});

Expand Down Expand Up @@ -112,7 +114,7 @@ describe.each([{ permission: "No" }])(
test(`${permission} key: try to update prefix search settings and be denied`, async () => {
const client = await getClient(permission);
await expect(
client.index(index.uid).updatePrefixSearch('disabled'),
client.index(index.uid).updatePrefixSearch("disabled"),
).rejects.toHaveProperty(
"cause.code",
ErrorStatusCode.MISSING_AUTHORIZATION_HEADER,
Expand Down Expand Up @@ -153,7 +155,7 @@ describe.each([
const client = new MeiliSearch({ host });
const strippedHost = trailing ? host.slice(0, -1) : host;
await expect(
client.index(index.uid).updatePrefixSearch('disabled'),
client.index(index.uid).updatePrefixSearch("disabled"),
).rejects.toHaveProperty(
"message",
`Request to ${strippedHost}/${route} has failed`,
Expand Down
10 changes: 7 additions & 3 deletions tests/settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe.each([{ permission: "Master" }, { permission: "Admin" }])(
dictionary: ["J. K.", "J. R. R."],
searchCutoffMs: 1000,
facetSearch: true,
prefixSearch: 'indexingTime',
prefixSearch: "indexingTime",
};
// Add the settings
const task = await client.index(index.uid).updateSettings(newSettings);
Expand Down Expand Up @@ -274,7 +274,9 @@ describe.each([{ permission: "Master" }, { permission: "Admin" }])(
test(`${permission} key: Update facetSearch settings on empty index`, async () => {
const client = await getClient(permission);

const { taskUid } = await client.index(index.uid).updateSettings({ facetSearch: false });
const { taskUid } = await client
.index(index.uid)
.updateSettings({ facetSearch: false });
await client.index(index.uid).waitForTask(taskUid);

const response = await client.index(index.uid).getSettings();
Expand All @@ -284,7 +286,9 @@ describe.each([{ permission: "Master" }, { permission: "Admin" }])(
test(`${permission} key: Update prefixSearch settings on an empty index`, async () => {
const client = await getClient(permission);

const { taskUid } = await client.index(index.uid).updateSettings({ prefixSearch: 'disabled' });
const { taskUid } = await client
.index(index.uid)
.updateSettings({ prefixSearch: "disabled" });
await client.index(index.uid).waitForTask(taskUid);

const response = await client.index(index.uid).getSettings();
Expand Down

0 comments on commit 33b1386

Please sign in to comment.