@defra/lis-hubs-infra-core 0.31.0 → 0.32.0
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 +1 -1
- package/src/base-client.test.js +4 -0
package/package.json
CHANGED
package/src/base-client.test.js
CHANGED
|
@@ -43,6 +43,7 @@ beforeEach(() => {
|
|
|
43
43
|
})
|
|
44
44
|
|
|
45
45
|
afterEach(() => {
|
|
46
|
+
vi.useRealTimers()
|
|
46
47
|
vi.clearAllMocks()
|
|
47
48
|
vi.restoreAllMocks()
|
|
48
49
|
})
|
|
@@ -81,6 +82,9 @@ describe('request verbs', () => {
|
|
|
81
82
|
'it sends %s requests via Wreck.request with the correlation and service token headers',
|
|
82
83
|
async (method, httpMethod) => {
|
|
83
84
|
// Arrange
|
|
85
|
+
// The body read gets what is left of the timeout, so the clock is frozen
|
|
86
|
+
// to keep a millisecond of elapsed time out of the forwarded options.
|
|
87
|
+
vi.useFakeTimers({ toFake: ['Date'] })
|
|
84
88
|
const client = createClient({ timeout: 5000 })
|
|
85
89
|
const res = { statusCode: 200 }
|
|
86
90
|
const request = vi.spyOn(Wreck, 'request').mockResolvedValue(res)
|