Skip to content

Commit 93d1c67

Browse files
Uzlopakcrysmags
authored andcommitted
chore: remove sinon dev dependency (nodejs#2767)
1 parent 1b77138 commit 93d1c67

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@
117117
"proxy": "^1.0.2",
118118
"proxyquire": "^2.1.3",
119119
"request": "^2.88.2",
120-
"sinon": "^17.0.1",
121120
"snazzy": "^9.0.0",
122121
"standard": "^17.0.0",
123122
"superagent": "^8.1.2",

test/no-strict-content-length.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
'use strict'
22

33
const { tspl } = require('@matteo.collina/tspl')
4+
const { ok } = require('node:assert')
45
const { test, after, describe } = require('node:test')
56
const { Client } = require('..')
67
const { createServer } = require('node:http')
78
const { Readable } = require('node:stream')
8-
const sinon = require('sinon')
99
const { wrapWithAsyncIterable } = require('./utils/async-iterators')
1010

11-
describe('strictContentLength: false', (t) => {
12-
const emitWarningStub = sinon.stub(process, 'emitWarning')
11+
describe('strictContentLength: false', () => {
12+
const emitWarningOriginal = process.emitWarning
13+
let emitWarningCalled = false
14+
15+
process.emitWarning = function () {
16+
emitWarningCalled = true
17+
}
1318

1419
function assertEmitWarningCalledAndReset () {
15-
sinon.assert.called(emitWarningStub)
16-
emitWarningStub.resetHistory()
20+
ok(emitWarningCalled)
21+
emitWarningCalled = false
1722
}
1823

1924
after(() => {
20-
emitWarningStub.restore()
25+
process.emitWarning = emitWarningOriginal
2126
})
2227

2328
test('request invalid content-length', async (t) => {

0 commit comments

Comments
 (0)