Skip to content

Commit 0657bf7

Browse files
committed
Lint
1 parent 7be408d commit 0657bf7

File tree

7 files changed

+28
-24
lines changed

7 files changed

+28
-24
lines changed

packages/instant-meilisearch/__tests__/search-resolver.test.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ export const searchResponse = {
1717
const mockedMultiSearch = jest
1818
.spyOn(MeiliSearch.prototype, 'multiSearch')
1919
.mockImplementation((request: MultiSearchParams) => {
20-
const response = request.queries.map((req: MeiliSearchMultiSearchParams) => ({
21-
...searchResponse,
22-
indexUid: req.indexUid,
23-
}))
20+
const response = request.queries.map(
21+
(req: MeiliSearchMultiSearchParams) => ({
22+
...searchResponse,
23+
indexUid: req.indexUid,
24+
})
25+
)
2426
return Promise.resolve({
2527
results: response,
2628
})
@@ -42,7 +44,6 @@ describe('Cached search tests', () => {
4244
await searchClient.search<Movies>([searchParameters])
4345
await searchClient.search<Movies>([searchParameters])
4446

45-
4647
expect(mockedMultiSearch).toHaveBeenCalledTimes(2)
4748
})
4849

@@ -64,7 +65,6 @@ describe('Cached search tests', () => {
6465
await searchClient.search<Movies>([searchParameters1])
6566
await searchClient.search<Movies>([searchParameters2])
6667

67-
6868
expect(mockedMultiSearch).toHaveBeenCalledTimes(3)
6969
})
7070

@@ -87,7 +87,6 @@ describe('Cached search tests', () => {
8787
await searchClient.search<Movies>([searchParameters2])
8888
await searchClient.search<Movies>([searchParameters1])
8989

90-
9190
expect(mockedMultiSearch).toHaveBeenCalledTimes(3)
9291
})
9392

@@ -111,7 +110,6 @@ describe('Cached search tests', () => {
111110
await searchClient.search<Movies>([searchParameters1])
112111
await searchClient.search<Movies>([searchParameters2])
113112

114-
115113
expect(mockedMultiSearch).toHaveBeenCalledTimes(3)
116114
})
117115

@@ -143,8 +141,6 @@ describe('Cached search tests', () => {
143141
await searchClient.search<Movies>(searchParameters1)
144142
await searchClient.search<Movies>([searchParameters2])
145143

146-
147-
148144
expect(mockedMultiSearch).toHaveBeenCalledTimes(3)
149145
})
150146
})

packages/instant-meilisearch/jest.config.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ const baseConfig = {
55
setupFilesAfterEnv: ['<rootDir>/scripts/jest_teardown.js'],
66
// Transform all JS and TS files with `ts-jest`
77
transform: {
8-
"^.+.(ts|js)?$": ["ts-jest", {
9-
// use ESM because we're loading the ESM build of `meilisearch-js`
10-
useESM: true,
11-
}],
8+
'^.+.(ts|js)?$': [
9+
'ts-jest',
10+
{
11+
// use ESM because we're loading the ESM build of `meilisearch-js`
12+
useESM: true,
13+
},
14+
],
1215
},
1316
// Allow `ts-jest` to resolve relative JS imports, e.g., `./folder/index.js`
1417
// See https://github.com/kulshekhar/ts-jest/issues/1057
1518
moduleNameMapper: {
16-
"(.+)\\.js": "$1"
19+
'(.+)\\.js': '$1',
1720
},
1821
// Treat TS as ESM. JS is automatically treated as ESM
1922
// if package.json has `"type": "module"`
@@ -25,12 +28,12 @@ export default {
2528
projects: [
2629
{
2730
...baseConfig,
28-
testEnvironment: "node",
29-
displayName: "node",
31+
testEnvironment: 'node',
32+
displayName: 'node',
3033
},
3134
{
3235
...baseConfig,
33-
displayName: "dom",
36+
displayName: 'dom',
3437
},
3538
],
3639
}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export * from './search-resolver.js'
22
export * from './search-params-adapter.js'
3-

packages/instant-meilisearch/src/client/instant-meilisearch-client.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ import {
2222
adaptSearchParams,
2323
SearchResolver,
2424
} from '../adapter/index.js'
25-
import { createSearchContext, createFacetSearchContext } from '../contexts/index.js'
25+
import {
26+
createSearchContext,
27+
createFacetSearchContext,
28+
} from '../contexts/index.js'
2629
import {
2730
SearchCache,
2831
initFacetDistribution,
@@ -89,9 +92,9 @@ export function instantMeiliSearch(
8992
meiliSearchParams === undefined
9093
? params
9194
: {
92-
...meiliSearchParams,
93-
...params,
94-
}
95+
...meiliSearchParams,
96+
...params,
97+
}
9598
},
9699
searchClient: {
97100
clearCache: () => searchCache.clearCache(),
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
export { createSearchContext, createFacetSearchContext } from './search-context.js'
1+
export {
2+
createSearchContext,
3+
createFacetSearchContext,
4+
} from './search-context.js'

0 commit comments

Comments
 (0)