@@ -26,8 +26,7 @@ import * as utils from '../utils';
2626import * as mocks from '../../resources/mocks' ;
2727
2828import { InstanceId } from '../../../src/instance-id/instance-id' ;
29- import { InstanceIdImpl } from '../../../src/instance-id/instance-id-internal' ;
30- import { FirebaseInstanceIdRequestHandler } from '../../../src/instance-id/instance-id-request' ;
29+ import { FirebaseInstanceIdRequestHandler } from '../../../src/instance-id/instance-id-request-internal' ;
3130import { FirebaseApp } from '../../../src/firebase-app' ;
3231import { FirebaseInstanceIdError , InstanceIdClientErrorCode } from '../../../src/utils/error' ;
3332
@@ -58,14 +57,14 @@ describe('InstanceId', () => {
5857 mockApp = mocks . app ( ) ;
5958 getTokenStub = utils . stubGetAccessToken ( undefined , mockApp ) ;
6059 mockCredentialApp = mocks . mockCredentialApp ( ) ;
61- iid = new InstanceIdImpl ( mockApp ) ;
60+ iid = new InstanceId ( mockApp ) ;
6261
6362 googleCloudProject = process . env . GOOGLE_CLOUD_PROJECT ;
6463 gcloudProject = process . env . GCLOUD_PROJECT ;
6564
66- nullAccessTokenClient = new InstanceIdImpl ( mocks . appReturningNullAccessToken ( ) ) ;
67- malformedAccessTokenClient = new InstanceIdImpl ( mocks . appReturningMalformedAccessToken ( ) ) ;
68- rejectedPromiseAccessTokenClient = new InstanceIdImpl ( mocks . appRejectedWhileFetchingAccessToken ( ) ) ;
65+ nullAccessTokenClient = new InstanceId ( mocks . appReturningNullAccessToken ( ) ) ;
66+ malformedAccessTokenClient = new InstanceId ( mocks . appReturningMalformedAccessToken ( ) ) ;
67+ rejectedPromiseAccessTokenClient = new InstanceId ( mocks . appRejectedWhileFetchingAccessToken ( ) ) ;
6968 } ) ;
7069
7170 afterEach ( ( ) => {
@@ -81,15 +80,15 @@ describe('InstanceId', () => {
8180 invalidApps . forEach ( ( invalidApp ) => {
8281 it ( 'should throw given invalid app: ' + JSON . stringify ( invalidApp ) , ( ) => {
8382 expect ( ( ) => {
84- const iidAny : any = InstanceIdImpl ;
83+ const iidAny : any = InstanceId ;
8584 return new iidAny ( invalidApp ) ;
8685 } ) . to . throw ( 'First argument passed to admin.instanceId() must be a valid Firebase app instance.' ) ;
8786 } ) ;
8887 } ) ;
8988
9089 it ( 'should throw given no app' , ( ) => {
9190 expect ( ( ) => {
92- const iidAny : any = InstanceIdImpl ;
91+ const iidAny : any = InstanceId ;
9392 return new iidAny ( ) ;
9493 } ) . to . throw ( 'First argument passed to admin.instanceId() must be a valid Firebase app instance.' ) ;
9594 } ) ;
@@ -98,14 +97,14 @@ describe('InstanceId', () => {
9897 // Project ID not set in the environment.
9998 delete process . env . GOOGLE_CLOUD_PROJECT ;
10099 delete process . env . GCLOUD_PROJECT ;
101- const instanceId = new InstanceIdImpl ( mockCredentialApp ) ;
100+ const instanceId = new InstanceId ( mockCredentialApp ) ;
102101 return instanceId . deleteInstanceId ( 'iid' )
103102 . should . eventually . rejectedWith ( noProjectIdError ) ;
104103 } ) ;
105104
106105 it ( 'should not throw given a valid app' , ( ) => {
107106 expect ( ( ) => {
108- return new InstanceIdImpl ( mockApp ) ;
107+ return new InstanceId ( mockApp ) ;
109108 } ) . not . to . throw ( ) ;
110109 } ) ;
111110 } ) ;
@@ -119,7 +118,7 @@ describe('InstanceId', () => {
119118 it ( 'is read-only' , ( ) => {
120119 expect ( ( ) => {
121120 ( iid as any ) . app = mockApp ;
122- } ) . to . throw ( 'Cannot set property app of #<InstanceIdImpl > which has only a getter' ) ;
121+ } ) . to . throw ( 'Cannot set property app of #<InstanceId > which has only a getter' ) ;
123122 } ) ;
124123 } ) ;
125124
0 commit comments