Skip to content

Commit 3aa24dd

Browse files
committed
Making installations mudularization step2, unit tests pass
1 parent 5d5001a commit 3aa24dd

File tree

5 files changed

+10
-14
lines changed

5 files changed

+10
-14
lines changed

packages-exp/installations-exp/src/functions/config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ import { extractAppConfig } from '../helpers/extract-app-config';
2424
import { name, version } from '../../package.json';
2525

2626
export function registerInstallations(): void {
27-
const installationsName = 'installations';
27+
const installationsName = 'installations-exp';
2828

2929
_registerComponent(
3030
new Component(
3131
installationsName,
3232
container => {
33-
const app = container.getProvider('app').getImmediate();
33+
const app = container.getProvider('app-exp').getImmediate();
3434

3535
// Throws if app isn't configured properly.
3636
const appConfig = extractAppConfig(app);
@@ -46,6 +46,6 @@ export function registerInstallations(): void {
4646
ComponentType.PUBLIC
4747
)
4848
);
49-
50-
registerVersion(name, version);
5149
}
50+
51+
registerVersion(name, version);

packages-exp/installations-exp/src/helpers/extract-app-config.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ describe('extractAppConfig', () => {
3838
expect(() => extractAppConfig(undefined as any)).to.throw(FirebaseError);
3939

4040
let firebaseApp = getFakeApp();
41-
delete firebaseApp.name;
41+
delete (firebaseApp as any).name;
4242
expect(() => extractAppConfig(firebaseApp)).to.throw(FirebaseError);
4343

4444
firebaseApp = getFakeApp();
45-
delete firebaseApp.options;
45+
delete (firebaseApp as any).options;
4646
expect(() => extractAppConfig(firebaseApp)).to.throw(FirebaseError);
4747

4848
firebaseApp = getFakeApp();

packages-exp/installations-exp/src/helpers/extract-app-config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { FirebaseApp, FirebaseOptions } from '@firebase/app-types';
18+
import { FirebaseApp, FirebaseOptions } from '@firebase/app-types-exp';
1919
import { FirebaseError } from '@firebase/util';
20-
import { AppConfig } from '@firebase/installations-types';
20+
import { AppConfig } from '@firebase/installations-types-exp';
2121
import { ERROR_FACTORY, ErrorCode } from '../util/errors';
2222

2323
export function extractAppConfig(app: FirebaseApp): AppConfig {

packages-exp/installations-exp/src/helpers/refresh-auth-token.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import { expect } from 'chai';
1919
import { SinonFakeTimers, SinonStub, stub, useFakeTimers } from 'sinon';
2020
import * as generateAuthTokenRequestModule from '../functions/generate-auth-token-request';
21-
import { FirebaseInstallations } from '@firebase/installations-types';
21+
import { FirebaseInstallations } from '@firebase/installations-types-exp';
2222
import {
2323
CompletedAuthToken,
2424
RegisteredInstallationEntry,

packages-exp/installations-exp/src/testing/fake-generators.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ export function getFakeApp(): FirebaseApp {
3939
storageBucket: 'storageBucket',
4040
appId: '1:777777777777:web:d93b5ca1475efe57'
4141
},
42-
automaticDataCollectionEnabled: true,
43-
delete: async () => {},
44-
// This won't be used in tests.
45-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
46-
installations: null as any
42+
automaticDataCollectionEnabled: true
4743
};
4844
}
4945

0 commit comments

Comments
 (0)