Skip to content

Commit

Permalink
test: remove usage of fake timers where it is not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Dec 13, 2021
1 parent cab4132 commit dbb2af6
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions tests/test_reply_headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
const { IncomingMessage } = require('http')
const { expect } = require('chai')
const sinon = require('sinon')
const fakeTimers = require('@sinonjs/fake-timers')
const nock = require('..')
const got = require('./got_client')

Expand Down Expand Up @@ -346,22 +345,10 @@ describe('`replyDate()`', () => {
})

describe('with mock timers', () => {
let clock
beforeEach(() => {
clock = fakeTimers.install()
})
afterEach(() => {
if (clock) {
clock.uninstall()
clock = undefined
}
})

it('sends date header with response', async () => {
const scope = nock('http://example.test').replyDate().get('/').reply()

const req = got('http://example.test/')
clock.tick()
const { headers } = await req
const date = new Date()
expect(headers).to.include({ date: date.toUTCString() })
Expand Down

0 comments on commit dbb2af6

Please sign in to comment.