@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/lis-hubs-infra-core",
3
- "version": "0.31.0",
3
+ "version": "0.32.0",
4
4
  "description": "Shared hub mechanics for livestock platform.",
5
5
  "main": "src/index.js",
6
6
  "repository": {
@@ -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)