Skip to content

Commit

Permalink
chore: remove sinon dev dependency (#2767)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak authored and ronag committed Feb 22, 2024
1 parent d1c7ff0 commit 31fb862
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
17 changes: 11 additions & 6 deletions test/no-strict-content-length.js
Original file line number Diff line number Diff line change
@@ -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) => {
Expand Down

0 comments on commit 31fb862

Please sign in to comment.