14
14
* limitations under the License.
15
15
*/
16
16
17
+ /* eslint-disable no-await-in-loop */
18
+
19
+ const nock = require ( 'nock' ) ;
20
+
17
21
// need to import the whole package to mock getAuthenticatorFromEnvironment
18
22
const sdkCorePackage = require ( 'ibm-cloud-sdk-core' ) ;
19
23
20
24
const { NoAuthAuthenticator, unitTestUtils } = sdkCorePackage ;
21
-
22
25
const TransitGatewayApisV1 = require ( '../../dist/transit-gateway-apis/v1' ) ;
23
- const nock = require ( 'nock' ) ;
24
-
25
- /* eslint-disable no-await-in-loop */
26
26
27
27
const {
28
28
getOptions,
@@ -62,7 +62,6 @@ getAuthenticatorMock.mockImplementation(() => new NoAuthAuthenticator());
62
62
let requiredGlobals ;
63
63
64
64
describe ( 'TransitGatewayApisV1' , ( ) => {
65
-
66
65
beforeEach ( ( ) => {
67
66
mock_createRequest ( ) ;
68
67
// these are changed when passed into the factory/constructor, so re-init
@@ -77,7 +76,7 @@ describe('TransitGatewayApisV1', () => {
77
76
}
78
77
getAuthenticatorMock . mockClear ( ) ;
79
78
} ) ;
80
-
79
+
81
80
describe ( 'the newInstance method' , ( ) => {
82
81
test ( 'should use defaults when options not provided' , ( ) => {
83
82
const testInstance = TransitGatewayApisV1 . newInstance ( requiredGlobals ) ;
@@ -223,9 +222,9 @@ describe('TransitGatewayApisV1', () => {
223
222
beforeEach ( ( ) => {
224
223
unmock_createRequest ( ) ;
225
224
const scope = nock ( serviceUrl )
226
- . get ( uri => uri . includes ( path ) )
225
+ . get ( ( uri ) => uri . includes ( path ) )
227
226
. reply ( 200 , mockPagerResponse1 )
228
- . get ( uri => uri . includes ( path ) )
227
+ . get ( ( uri ) => uri . includes ( path ) )
229
228
. reply ( 200 , mockPagerResponse2 ) ;
230
229
} ) ;
231
230
@@ -715,9 +714,9 @@ describe('TransitGatewayApisV1', () => {
715
714
beforeEach ( ( ) => {
716
715
unmock_createRequest ( ) ;
717
716
const scope = nock ( serviceUrl )
718
- . get ( uri => uri . includes ( path ) )
717
+ . get ( ( uri ) => uri . includes ( path ) )
719
718
. reply ( 200 , mockPagerResponse1 )
720
- . get ( uri => uri . includes ( path ) )
719
+ . get ( ( uri ) => uri . includes ( path ) )
721
720
. reply ( 200 , mockPagerResponse2 ) ;
722
721
} ) ;
723
722
@@ -861,9 +860,9 @@ describe('TransitGatewayApisV1', () => {
861
860
beforeEach ( ( ) => {
862
861
unmock_createRequest ( ) ;
863
862
const scope = nock ( serviceUrl )
864
- . get ( uri => uri . includes ( path ) )
863
+ . get ( ( uri ) => uri . includes ( path ) )
865
864
. reply ( 200 , mockPagerResponse1 )
866
- . get ( uri => uri . includes ( path ) )
865
+ . get ( ( uri ) => uri . includes ( path ) )
867
866
. reply ( 200 , mockPagerResponse2 ) ;
868
867
} ) ;
869
868
0 commit comments