@open-mercato/search 0.10.1-develop.7748.1.d745ba61aa → 0.10.1-develop.7751.1.a11f57298b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/__tests__/service.test.ts +20 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/search",
|
|
3
|
-
"version": "0.10.1-develop.
|
|
3
|
+
"version": "0.10.1-develop.7751.1.a11f57298b",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -127,9 +127,9 @@
|
|
|
127
127
|
"zod": "^4.4.3"
|
|
128
128
|
},
|
|
129
129
|
"peerDependencies": {
|
|
130
|
-
"@open-mercato/core": "0.10.1-develop.
|
|
131
|
-
"@open-mercato/queue": "0.10.1-develop.
|
|
132
|
-
"@open-mercato/shared": "0.10.1-develop.
|
|
130
|
+
"@open-mercato/core": "0.10.1-develop.7751.1.a11f57298b",
|
|
131
|
+
"@open-mercato/queue": "0.10.1-develop.7751.1.a11f57298b",
|
|
132
|
+
"@open-mercato/shared": "0.10.1-develop.7751.1.a11f57298b"
|
|
133
133
|
},
|
|
134
134
|
"devDependencies": {
|
|
135
135
|
"@types/jest": "^30.0.0",
|
|
@@ -582,21 +582,26 @@ describe('SearchService', () => {
|
|
|
582
582
|
availabilityCacheTtlMs: 0,
|
|
583
583
|
})
|
|
584
584
|
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
585
|
+
jest.useFakeTimers({ now: 0 })
|
|
586
|
+
try {
|
|
587
|
+
const start = Date.now()
|
|
588
|
+
const search = service.search('q', { tenantId: 't-1' })
|
|
589
|
+
await jest.runAllTimersAsync()
|
|
590
|
+
await search
|
|
591
|
+
const elapsed = Date.now() - start
|
|
592
|
+
const timings = Object.values(probeTimings)
|
|
593
|
+
const latestStart = Math.max(...timings.map((timing) => timing.start))
|
|
594
|
+
const earliestEnd = Math.min(...timings.map((timing) => timing.end))
|
|
595
|
+
|
|
596
|
+
expect(timings).toHaveLength(3)
|
|
597
|
+
expect(latestStart).toBeLessThan(earliestEnd)
|
|
598
|
+
expect(elapsed).toBeLessThan(450)
|
|
599
|
+
expect(slowA.isAvailable).toHaveBeenCalledTimes(1)
|
|
600
|
+
expect(slowB.isAvailable).toHaveBeenCalledTimes(1)
|
|
601
|
+
expect(slowC.isAvailable).toHaveBeenCalledTimes(1)
|
|
602
|
+
} finally {
|
|
603
|
+
jest.useRealTimers()
|
|
604
|
+
}
|
|
600
605
|
})
|
|
601
606
|
|
|
602
607
|
it('caches positive availability checks within the TTL window', async () => {
|