Skip to content

Commit

Permalink
fixup! refactor: simply use of siinon fake timers
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Apr 21, 2024
1 parent 5b6208f commit 1c6a54f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('proxy', function () {
let targetPort: number

beforeEach(function (done) {
clock = sinon.useFakeTimers()
clock = sinon.useFakeTimers({ shouldClearNativeTimers: true })
port = nextPort()
server = createServer({
proxy: true
Expand Down
9 changes: 4 additions & 5 deletions test/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('server', function () {
port = nextPort()
server = createServer()
server.listen(port, done)
clock = sinon.useFakeTimers()
clock = sinon.useFakeTimers({ shouldClearNativeTimers: true })
})

beforeEach(function (done) {
Expand Down Expand Up @@ -535,7 +535,6 @@ describe('server', function () {
})

it.skip('should calculate the response twice after the interval', function (done) {
clock = sinon.useFakeTimers()
let first = true
const delay = (parameters.exchangeLifetime * 1000) + 1

Expand Down Expand Up @@ -1181,7 +1180,7 @@ describe('server LRU', function () {
}

beforeEach(function (done) {
clock = sinon.useFakeTimers()
clock = sinon.useFakeTimers({ shouldClearNativeTimers: true })
port = nextPort()
server = createServer()
server.listen(port, done)
Expand Down Expand Up @@ -1236,7 +1235,7 @@ describe('server block cache', function () {
}

beforeEach(function (done) {
clock = sinon.useFakeTimers()
clock = sinon.useFakeTimers({ shouldClearNativeTimers: true })
port = nextPort()
server = createServer()
server.listen(port, done)
Expand Down Expand Up @@ -1297,7 +1296,7 @@ describe('Client Identifier', function () {
}

beforeEach(function (done) {
clock = sinon.useFakeTimers()
clock = sinon.useFakeTimers({ shouldClearNativeTimers: true })
port = nextPort()

server = createServer({
Expand Down
2 changes: 1 addition & 1 deletion test/share-socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ describe('share-socket', function () {
})

it('should error after ~247 seconds', function (done) {
const clock = sinon.useFakeTimers()
const clock = sinon.useFakeTimers({ shouldClearNativeTimers: true })
const req = request(`coap://localhost:${port + 1}`)
req.end()

Expand Down

0 comments on commit 1c6a54f

Please sign in to comment.