@@ -10,7 +10,6 @@ import { HttpMethod, RequestContext } from '.';
10
10
use ( chaiAsPromised ) ;
11
11
12
12
describe ( 'AzureAuth' , ( ) => {
13
-
14
13
const testUrl1 = 'https://test1.com' ;
15
14
var auth : AzureAuth ;
16
15
beforeEach ( ( ) => {
@@ -58,14 +57,14 @@ describe('AzureAuth', () => {
58
57
} ,
59
58
} as User ,
60
59
) ;
61
- let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET )
60
+ let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET ) ;
62
61
63
- await config . applySecurityAuthentication ( requestContext )
62
+ await config . applySecurityAuthentication ( requestContext ) ;
64
63
expect ( requestContext . getHeaders ( ) ) . to . not . be . undefined ;
65
64
expect ( requestContext . getHeaders ( ) [ 'Authorization' ] ) . to . equal ( `Bearer ${ token } ` ) ;
66
65
67
66
requestContext . setHeaderParam ( 'Host' , 'foo.com' ) ;
68
- await config . applySecurityAuthentication ( requestContext )
67
+ await config . applySecurityAuthentication ( requestContext ) ;
69
68
expect ( requestContext . getHeaders ( ) . Authorization ) . to . equal ( `Bearer ${ token } ` ) ;
70
69
} ) ;
71
70
@@ -83,9 +82,9 @@ describe('AzureAuth', () => {
83
82
} ,
84
83
} as User ,
85
84
) ;
86
- let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET )
85
+ let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET ) ;
87
86
88
- await config . applySecurityAuthentication ( requestContext )
87
+ await config . applySecurityAuthentication ( requestContext ) ;
89
88
expect ( requestContext . getHeaders ( ) ) . to . not . be . undefined ;
90
89
expect ( requestContext . getHeaders ( ) [ 'Authorization' ] ) . to . equal ( `Bearer ${ token } ` ) ;
91
90
} ) ;
@@ -104,9 +103,9 @@ describe('AzureAuth', () => {
104
103
} ,
105
104
} as User ,
106
105
) ;
107
- let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET )
106
+ let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET ) ;
108
107
109
- await config . applySecurityAuthentication ( requestContext )
108
+ await config . applySecurityAuthentication ( requestContext ) ;
110
109
// @ts -ignore
111
110
expect ( requestContext . getAgent ( ) . options . rejectUnauthorized ) . to . equal ( false ) ;
112
111
} ) ;
@@ -127,9 +126,9 @@ describe('AzureAuth', () => {
127
126
} ,
128
127
} as User ,
129
128
) ;
130
- let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET )
129
+ let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET ) ;
131
130
132
- await config . applySecurityAuthentication ( requestContext )
131
+ await config . applySecurityAuthentication ( requestContext ) ;
133
132
// @ts -ignore
134
133
expect ( requestContext . getAgent ( ) . options . rejectUnauthorized ) . to . equal ( undefined ) ;
135
134
} ) ;
@@ -147,9 +146,11 @@ describe('AzureAuth', () => {
147
146
} ,
148
147
} as User ,
149
148
) ;
150
- let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET )
149
+ let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET ) ;
151
150
152
- return expect ( config . applySecurityAuthentication ( requestContext ) ) . to . eventually . be . rejectedWith ( 'Token is expired!' ) ;
151
+ return expect ( config . applySecurityAuthentication ( requestContext ) ) . to . eventually . be . rejectedWith (
152
+ 'Token is expired!' ,
153
+ ) ;
153
154
} ) ;
154
155
155
156
it ( 'should throw with bad command' , ( ) => {
@@ -167,9 +168,11 @@ describe('AzureAuth', () => {
167
168
} ,
168
169
} as User ,
169
170
) ;
170
- let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET )
171
+ let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET ) ;
171
172
172
- return expect ( config . applySecurityAuthentication ( requestContext ) ) . to . eventually . be . rejectedWith ( / F a i l e d t o r e f r e s h t o k e n / ) ;
173
+ return expect ( config . applySecurityAuthentication ( requestContext ) ) . to . eventually . be . rejectedWith (
174
+ / F a i l e d t o r e f r e s h t o k e n / ,
175
+ ) ;
173
176
} ) ;
174
177
175
178
it ( 'should exec when no cmd and token is not expired' , async ( ) => {
@@ -187,7 +190,7 @@ describe('AzureAuth', () => {
187
190
} ,
188
191
} as User ,
189
192
) ;
190
- let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET )
193
+ let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET ) ;
191
194
await config . applySecurityAuthentication ( requestContext ) ;
192
195
} ) ;
193
196
@@ -215,8 +218,8 @@ describe('AzureAuth', () => {
215
218
} as User ,
216
219
) ;
217
220
218
- let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET )
219
- await config . applySecurityAuthentication ( requestContext )
221
+ let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET ) ;
222
+ await config . applySecurityAuthentication ( requestContext ) ;
220
223
221
224
expect ( requestContext . getHeaders ( ) ) . to . not . be . undefined ;
222
225
expect ( requestContext . getHeaders ( ) [ 'Authorization' ] ) . to . equal ( `Bearer ${ token } ` ) ;
@@ -243,8 +246,8 @@ describe('AzureAuth', () => {
243
246
} ,
244
247
} as User ,
245
248
) ;
246
- let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET )
247
- await config . applySecurityAuthentication ( requestContext )
249
+ let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET ) ;
250
+ await config . applySecurityAuthentication ( requestContext ) ;
248
251
249
252
expect ( requestContext . getHeaders ( ) ) . to . not . be . undefined ;
250
253
expect ( requestContext . getHeaders ( ) [ 'Authorization' ] ) . to . equal ( `Bearer ${ token } ` ) ;
@@ -271,8 +274,8 @@ describe('AzureAuth', () => {
271
274
} ,
272
275
} as User ,
273
276
) ;
274
- let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET )
275
- await config . applySecurityAuthentication ( requestContext )
277
+ let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET ) ;
278
+ await config . applySecurityAuthentication ( requestContext ) ;
276
279
277
280
expect ( requestContext . getHeaders ( ) ) . to . not . be . undefined ;
278
281
expect ( requestContext . getHeaders ( ) [ 'Authorization' ] ) . to . equal ( `Bearer ${ token } ` ) ;
@@ -299,8 +302,8 @@ describe('AzureAuth', () => {
299
302
} ,
300
303
} as User ,
301
304
) ;
302
- let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET )
303
- await config . applySecurityAuthentication ( requestContext )
305
+ let requestContext = new RequestContext ( testUrl1 , HttpMethod . GET ) ;
306
+ await config . applySecurityAuthentication ( requestContext ) ;
304
307
305
308
expect ( requestContext . getHeaders ( ) ) . to . not . be . undefined ;
306
309
expect ( requestContext . getHeaders ( ) [ 'Authorization' ] ) . to . equal ( `Bearer ${ token } ` ) ;
0 commit comments