Skip to content

Commit

Permalink
Merge #1518
Browse files Browse the repository at this point in the history
1518: Fix get typo tolerance return type r=bidoubiwa a=bidoubiwa

Following #1455, this PR fixes the test of the PR.

Co-authored-by: Ricco Xie <[email protected]>
Co-authored-by: Charlotte Vermandel <[email protected]>
  • Loading branch information
3 people authored Jun 14, 2023
2 parents 84c5ab0 + dcb2944 commit 532df46
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/indexes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1017,9 +1017,9 @@ class Index<T extends Record<string, any> = Record<string, any>> {
*
* @returns Promise containing the typo tolerance settings.
*/
async getTypoTolerance(): Promise<string[]> {
async getTypoTolerance(): Promise<TypoTolerance> {
const url = `indexes/${this.uid}/settings/typo-tolerance`
return await this.httpRequest.get<string[]>(url)
return await this.httpRequest.get<TypoTolerance>(url)
}

/**
Expand Down
4 changes: 1 addition & 3 deletions tests/typo_tolerance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ describe.each([{ permission: 'Master' }, { permission: 'Admin' }])(

test(`${permission} key: Get default typo tolerance settings`, async () => {
const client = await getClient(permission)
const response: string[] = await client
.index(index.uid)
.getTypoTolerance()
const response = await client.index(index.uid).getTypoTolerance()
expect(response).toEqual(defaultTypoTolerance)
})

Expand Down

0 comments on commit 532df46

Please sign in to comment.