Skip to content

Commit 6c28ca6

Browse files
committed
Make tests work again
1 parent ade5bef commit 6c28ca6

File tree

10 files changed

+25
-24
lines changed

10 files changed

+25
-24
lines changed

integration/browserify/src/namespace.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ firebase.initializeApp({
2525
databaseURL: 'https://test-project-name.firebaseio.com',
2626
projectId: 'test-project-name',
2727
storageBucket: 'test-project-name.appspot.com',
28-
messagingSenderId: '012345678910'
28+
messagingSenderId: '012345678910',
29+
appId: 'myAppId'
2930
});
3031

3132
describe('Firebase Namespace Validation', function() {

integration/shared/namespaceDefinition.json

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
},
4141
"INTERNAL": {
4242
"__type": "object",
43-
"registerService": {
43+
"registerComponent": {
4444
"__type": "function"
4545
},
4646
"extendNamespace": {
@@ -55,20 +55,8 @@
5555
"removeApp": {
5656
"__type": "function"
5757
},
58-
"factories": {
59-
"__type": "object",
60-
"storage": {
61-
"__type": "function"
62-
},
63-
"auth": {
64-
"__type": "function"
65-
},
66-
"database": {
67-
"__type": "function"
68-
},
69-
"messaging": {
70-
"__type": "function"
71-
}
58+
"components": {
59+
"__type": "Map"
7260
},
7361
"ErrorFactory": {
7462
"__type": "function"

integration/typescript/test/namespace.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ firebase.initializeApp({
2525
databaseURL: 'https://test-project-name.firebaseio.com',
2626
projectId: 'test-project-name',
2727
storageBucket: 'test-project-name.appspot.com',
28-
messagingSenderId: '012345678910'
28+
messagingSenderId: '012345678910',
29+
appId: 'myAppId'
2930
});
3031

3132
describe('Firebase Namespace Validation', function() {

integration/webpack/src/namespace.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ firebase.initializeApp({
2525
databaseURL: 'https://test-project-name.firebaseio.com',
2626
projectId: 'test-project-name',
2727
storageBucket: 'test-project-name.appspot.com',
28-
messagingSenderId: '012345678910'
28+
messagingSenderId: '012345678910',
29+
appId: 'myAppId'
2930
});
3031

3132
describe('Firebase Namespace Validation', function() {

packages/app-types/private.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { FirebaseApp, FirebaseNamespace } from '@firebase/app-types';
2424
import { Observer, Subscribe } from '@firebase/util';
2525
import { FirebaseError, ErrorFactory } from '@firebase/util';
2626
import { Deferred } from '../firestore/test/util/promise';
27-
import { Component } from '@firebase/component';
27+
import { Component, ComponentContainer } from '@firebase/component';
2828

2929
export interface FirebaseServiceInternals {
3030
/**
@@ -82,7 +82,8 @@ export interface FirebaseAppInternals {
8282
}
8383

8484
export interface _FirebaseApp extends FirebaseApp {
85-
_addComponent(component: Component): void;
85+
container: ComponentContainer;
86+
_addComponent(component: Component, overwrite?: boolean): void;
8687
_removeServiceInstance(name: string, instanceIdentifier?: string): void;
8788
}
8889
export interface _FirebaseNamespace extends FirebaseNamespace {

packages/component/src/provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class Provider<T extends Name> {
3636
constructor(
3737
private readonly name: T,
3838
private readonly container: ComponentContainer
39-
) {}
39+
) { }
4040

4141
/**
4242
* @param identifier A provider can provide mulitple instances of a service

packages/functions/src/context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ export class ContextProvider {
3737
authProvider: Provider<FirebaseAuthInternal>,
3838
messagingProvider: Provider<FirebaseMessaging>
3939
) {
40-
this.auth = authProvider.getImmediate(undefined, { optional: true });
41-
this.messaging = messagingProvider.getImmediate(undefined, {
40+
this.auth = authProvider.getImmediate({ optional: true });
41+
this.messaging = messagingProvider.getImmediate({
4242
optional: true
4343
});
4444

packages/messaging-types/index.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,11 @@ export class FirebaseMessaging {
4949
useServiceWorker(registration: ServiceWorkerRegistration): void;
5050
usePublicVapidKey(b64PublicKey: string): void;
5151
}
52+
53+
declare module '@firebase/component' {
54+
interface ComponentContainer {
55+
getProvider(name: 'messaging'): Provider<FirebaseMessaging>;
56+
}
57+
58+
interface Provider { }
59+
}

packages/rxfire/test/database.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ describe('RxFire Database', () => {
9292
*/
9393
beforeEach(() => {
9494
app = initializeApp({
95+
apiKey: TEST_PROJECT.apiKey,
9596
projectId: TEST_PROJECT.projectId,
9697
databaseURL: TEST_PROJECT.databaseURL
9798
});

packages/storage/src/implementation/authwrapper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export class AuthWrapper {
8989
}
9090

9191
getAuthToken(): Promise<string | null> {
92-
const auth = this.authProvider_.getImmediate(undefined, { optional: true });
92+
const auth = this.authProvider_.getImmediate({ optional: true });
9393
if (auth) {
9494
return auth.getToken().then(
9595
(response: FirebaseAuthTokenData | null): string | null => {

0 commit comments

Comments
 (0)