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