Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

Commit 04472c0

Browse files
committed
fix
1 parent 62b1c83 commit 04472c0

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

test/nodejs-common/util.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ import {
4949
} from '../../src/nodejs-common/util.js';
5050
import {DEFAULT_PROJECT_ID_TOKEN} from '../../src/nodejs-common/service.js';
5151
import duplexify from 'duplexify';
52-
import {EventEmitter, Writable} from 'stream';
5352

5453
nock.disableNetConnect();
5554

@@ -1986,6 +1985,7 @@ describe('common/util', () => {
19861985
});
19871986
});
19881987
});
1988+
19891989
function 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) {

0 commit comments

Comments
 (0)