diff --git a/package.json b/package.json index 0c42aa0696f..c85ec55102f 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,6 @@ "proxy": "^1.0.2", "proxyquire": "^2.1.3", "request": "^2.88.2", - "sinon": "^17.0.1", "snazzy": "^9.0.0", "standard": "^17.0.0", "superagent": "^8.1.2", diff --git a/test/no-strict-content-length.js b/test/no-strict-content-length.js index d74f4677d56..aa3d1725cb2 100644 --- a/test/no-strict-content-length.js +++ b/test/no-strict-content-length.js @@ -1,23 +1,28 @@ 'use strict' const { tspl } = require('@matteo.collina/tspl') +const { ok } = require('node:assert') const { test, after, describe } = require('node:test') const { Client } = require('..') const { createServer } = require('node:http') const { Readable } = require('node:stream') -const sinon = require('sinon') const { wrapWithAsyncIterable } = require('./utils/async-iterators') -describe('strictContentLength: false', (t) => { - const emitWarningStub = sinon.stub(process, 'emitWarning') +describe('strictContentLength: false', () => { + const emitWarningOriginal = process.emitWarning + let emitWarningCalled = false + + process.emitWarning = function () { + emitWarningCalled = true + } function assertEmitWarningCalledAndReset () { - sinon.assert.called(emitWarningStub) - emitWarningStub.resetHistory() + ok(emitWarningCalled) + emitWarningCalled = false } after(() => { - emitWarningStub.restore() + process.emitWarning = emitWarningOriginal }) test('request invalid content-length', async (t) => {