@@ -57,7 +57,7 @@ describe('AppCheckApiClient', () => {
5757
5858 const TEST_RESPONSE = {
5959 attestationToken : 'token' ,
60- timeToLive : '3s'
60+ ttl : '3s'
6161 } ;
6262
6363 const mockOptions = {
@@ -182,15 +182,15 @@ describe('AppCheckApiClient', () => {
182182
183183 [ '' , 'abc' , '3s2' , 'sssa' , '3.000000001' , '3.2' , null , NaN , true , [ ] , { } , 100 , 1.2 , - 200 , - 2.4 ]
184184 . forEach ( ( invalidDuration ) => {
185- it ( `should throw if the returned timeToLive duration is: ${ invalidDuration } ` , ( ) => {
185+ it ( `should throw if the returned ttl duration is: ${ invalidDuration } ` , ( ) => {
186186 const response = deepCopy ( TEST_RESPONSE ) ;
187- ( response as any ) . timeToLive = invalidDuration ;
187+ ( response as any ) . ttl = invalidDuration ;
188188 const stub = sinon
189189 . stub ( HttpClient . prototype , 'send' )
190190 . resolves ( utils . responseFrom ( response , 200 ) ) ;
191191 stubs . push ( stub ) ;
192192 const expected = new FirebaseAppCheckError (
193- 'invalid-argument' , '`timeToLive ` must be a valid duration string with the suffix `s`.' ) ;
193+ 'invalid-argument' , '`ttl ` must be a valid duration string with the suffix `s`.' ) ;
194194 return apiClient . exchangeToken ( TEST_TOKEN_TO_EXCHANGE , APP_ID )
195195 . should . eventually . be . rejected . and . deep . include ( expected ) ;
196196 } ) ;
@@ -207,7 +207,7 @@ describe('AppCheckApiClient', () => {
207207 expect ( resp . ttlMillis ) . to . deep . equal ( 3000 ) ;
208208 expect ( stub ) . to . have . been . calledOnce . and . calledWith ( {
209209 method : 'POST' ,
210- url : `https://firebaseappcheck.googleapis.com/v1alpha /projects/test-project/apps/${ APP_ID } :exchangeCustomToken` ,
210+ url : `https://firebaseappcheck.googleapis.com/v1beta /projects/test-project/apps/${ APP_ID } :exchangeCustomToken` ,
211211 headers : EXPECTED_HEADERS ,
212212 data : { customToken : TEST_TOKEN_TO_EXCHANGE }
213213 } ) ;
@@ -219,10 +219,10 @@ describe('AppCheckApiClient', () => {
219219 // 3 seconds with 0 nanoseconds expressed as "3s"
220220 // 3 seconds and 1 nanosecond expressed as "3.000000001s"
221221 // 3 seconds and 1 microsecond expressed as "3.000001s"
222- it ( `should resolve with ttlMillis as ${ ttlMillis } when timeToLive
222+ it ( `should resolve with ttlMillis as ${ ttlMillis } when ttl
223223 from server is: ${ ttlString } ` , ( ) => {
224224 const response = deepCopy ( TEST_RESPONSE ) ;
225- ( response as any ) . timeToLive = ttlString ;
225+ ( response as any ) . ttl = ttlString ;
226226 const stub = sinon
227227 . stub ( HttpClient . prototype , 'send' )
228228 . resolves ( utils . responseFrom ( response , 200 ) ) ;
0 commit comments