File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 117
117
"proxy" : " ^1.0.2" ,
118
118
"proxyquire" : " ^2.1.3" ,
119
119
"request" : " ^2.88.2" ,
120
- "sinon" : " ^17.0.1" ,
121
120
"snazzy" : " ^9.0.0" ,
122
121
"standard" : " ^17.0.0" ,
123
122
"superagent" : " ^8.1.2" ,
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
3
const { tspl } = require ( '@matteo.collina/tspl' )
4
+ const { ok } = require ( 'node:assert' )
4
5
const { test, after, describe } = require ( 'node:test' )
5
6
const { Client } = require ( '..' )
6
7
const { createServer } = require ( 'node:http' )
7
8
const { Readable } = require ( 'node:stream' )
8
- const sinon = require ( 'sinon' )
9
9
const { wrapWithAsyncIterable } = require ( './utils/async-iterators' )
10
10
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
+ }
13
18
14
19
function assertEmitWarningCalledAndReset ( ) {
15
- sinon . assert . called ( emitWarningStub )
16
- emitWarningStub . resetHistory ( )
20
+ ok ( emitWarningCalled )
21
+ emitWarningCalled = false
17
22
}
18
23
19
24
after ( ( ) => {
20
- emitWarningStub . restore ( )
25
+ process . emitWarning = emitWarningOriginal
21
26
} )
22
27
23
28
test ( 'request invalid content-length' , async ( t ) => {
You can’t perform that action at this time.
0 commit comments