@@ -18,11 +18,10 @@ import * as pjy from '@google-cloud/projectify';
1818import * as pfy from '@google-cloud/promisify' ;
1919import * as assert from 'assert' ;
2020import * as extend from 'extend' ;
21- import { CallOptions } from '@grpc/grpc-js' ;
2221import * as is from 'is' ;
2322import * as proxyquire from 'proxyquire' ;
2423import * as sinon from 'sinon' ;
25- import * as through from 'through2 ' ;
24+ import { Transform } from 'stream ' ;
2625
2726import { google } from '../proto/datastore' ;
2827import * as ds from '../src' ;
@@ -367,12 +366,11 @@ describe('Request', () => {
367366
368367 it ( 'should end stream' , done => {
369368 const stream = request . createReadStream ( key ) ;
370-
371369 stream
372370 . on ( 'data' , ( ) => { } )
373371 . on ( 'error' , ( ) => {
374372 setImmediate ( ( ) => {
375- assert . strictEqual ( ( stream as Any ) . _destroyed , true ) ;
373+ assert . strictEqual ( stream . destroyed , true ) ;
376374 done ( ) ;
377375 } ) ;
378376 } ) ;
@@ -604,7 +602,7 @@ describe('Request', () => {
604602
605603 beforeEach ( ( ) => {
606604 request . createReadStream = sandbox . spy ( ( ) => {
607- const stream = through . obj ( ) ;
605+ const stream = new Transform ( { objectMode : true } ) ;
608606 setImmediate ( ( ) => {
609607 fakeEntities . forEach ( entity => stream . push ( entity ) ) ;
610608 stream . push ( null ) ;
@@ -656,7 +654,7 @@ describe('Request', () => {
656654
657655 beforeEach ( ( ) => {
658656 request . createReadStream = sandbox . spy ( ( ) => {
659- const stream = through . obj ( ) ;
657+ const stream = new Transform ( { objectMode : true } ) ;
660658 setImmediate ( ( ) => {
661659 stream . emit ( 'error' , error ) ;
662660 } ) ;
@@ -1081,7 +1079,7 @@ describe('Request', () => {
10811079
10821080 beforeEach ( ( ) => {
10831081 request . runQueryStream = sandbox . spy ( ( ) => {
1084- const stream = through . obj ( ) ;
1082+ const stream = new Transform ( { objectMode : true } ) ;
10851083
10861084 setImmediate ( ( ) => {
10871085 stream . emit ( 'info' , fakeInfo ) ;
@@ -1139,7 +1137,7 @@ describe('Request', () => {
11391137
11401138 beforeEach ( ( ) => {
11411139 request . runQueryStream = sandbox . spy ( ( ) => {
1142- const stream = through . obj ( ) ;
1140+ const stream = new Transform ( { objectMode : true } ) ;
11431141
11441142 setImmediate ( ( ) => {
11451143 stream . emit ( 'error' , error ) ;
0 commit comments