This repository was archived by the owner on Mar 3, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ import {
4949} from '../../src/nodejs-common/util.js' ;
5050import { DEFAULT_PROJECT_ID_TOKEN } from '../../src/nodejs-common/service.js' ;
5151import duplexify from 'duplexify' ;
52- import { EventEmitter , Writable } from 'stream' ;
5352
5453nock . disableNetConnect ( ) ;
5554
@@ -1986,6 +1985,7 @@ describe('common/util', () => {
19861985 } ) ;
19871986 } ) ;
19881987} ) ;
1988+
19891989function createMakeRequestStub (
19901990 sandbox : sinon . SinonSandbox ,
19911991 networkError : Error ,
@@ -2000,9 +2000,12 @@ function createMakeRequestStub(
20002000 sandbox
20012001 . stub ( util , 'makeRequest' )
20022002 . callsFake ( ( _authenticatedReqOpts , cfg , callback ) => {
2003- const mockRequestStream = new EventEmitter ( ) as unknown as Writable & {
2004- abort : ( ) => void ;
2005- } ;
2003+ const mockRequestStream = new stream . Duplex ( {
2004+ write ( _chunk , _encoding , callback ) {
2005+ callback ( ) ;
2006+ } ,
2007+ read ( ) { } ,
2008+ } ) as stream . Duplex & { abort : ( ) => void } ;
20062009 mockRequestStream . abort = ( ) => { } ;
20072010
20082011 if ( ! cfg . stream ) {
You can’t perform that action at this time.
0 commit comments