13
13
// limitations under the License.
14
14
15
15
import * as assert from 'assert' ;
16
- import { describe , it } from 'mocha' ;
16
+ import { describe , it , beforeEach , afterEach } from 'mocha' ;
17
17
import * as proxyquire from 'proxyquire' ;
18
18
import * as sinon from 'sinon' ;
19
19
import { PassThrough , Transform } from 'stream' ;
@@ -22,13 +22,16 @@ import * as P from '../src';
22
22
import { paginator , ParsedArguments } from '../src' ;
23
23
24
24
const util = {
25
- noop : ( ) => { } ,
25
+ noop : ( ) => {
26
+ // do nothing
27
+ } ,
26
28
} ;
27
29
28
30
class FakeResourceStream extends Transform {
29
31
calledWith : IArguments ;
30
32
constructor ( ) {
31
33
super ( { objectMode : true } ) ;
34
+ /* eslint-disable-next-line prefer-rest-params */
32
35
this . calledWith = arguments ;
33
36
}
34
37
}
@@ -39,18 +42,21 @@ const p = proxyquire('../src', {
39
42
40
43
const sandbox = sinon . createSandbox ( ) ;
41
44
45
+ // eslint-disable-next-line no-undef
42
46
afterEach ( ( ) => {
43
47
sandbox . restore ( ) ;
44
48
} ) ;
45
49
46
- // tslint:disable-next-line no-any
50
+ /* eslint-disable @typescript-eslint/ no-explicit- any */
47
51
function createFakeStream < T = any > ( ) {
48
52
return new PassThrough ( { objectMode : true } ) as P . ResourceStream < T > ;
49
53
}
50
54
51
55
describe ( 'paginator' , ( ) => {
52
56
const UUID = uuid . v1 ( ) ;
53
- function FakeClass ( ) { }
57
+ function FakeClass ( ) {
58
+ // do nothing
59
+ }
54
60
55
61
beforeEach ( ( ) => {
56
62
FakeClass . prototype . methodToExtend = ( ) => {
@@ -75,7 +81,6 @@ describe('paginator', () => {
75
81
76
82
it ( 'should accept an array or string method names' , ( ) => {
77
83
const originalMethod = FakeClass . prototype . methodToExtend ;
78
- FakeClass . prototype . anotherMethodToExtend = ( ) => { } ;
79
84
const anotherMethod = FakeClass . prototype . anotherMethodToExtend ;
80
85
const methodsToExtend = [ 'methodToExtend' , 'anotherMethodToExtend' ] ;
81
86
paginator . extend ( FakeClass , methodsToExtend ) ;
@@ -117,7 +122,7 @@ describe('paginator', () => {
117
122
return this . uuid ;
118
123
} ;
119
124
120
- // tslint: disable-next-line: no-any
125
+ /* eslint- disable @typescript-eslint/ no-explicit- any */
121
126
const cls = new ( FakeClass as any ) ( ) ;
122
127
cls . uuid = uuid . v1 ( ) ;
123
128
@@ -159,7 +164,7 @@ describe('paginator', () => {
159
164
return args as ParsedArguments ;
160
165
} ) ;
161
166
sandbox . stub ( paginator , 'runAsStream_' ) . callsFake ( createFakeStream ) ;
162
- FakeClass . prototype . streamMethod . apply ( FakeClass . prototype , fakeArgs ) ;
167
+ FakeClass . prototype . streamMethod ( ... fakeArgs ) ;
163
168
} ) ;
164
169
165
170
it ( 'should run the method as a stream' , done => {
0 commit comments