Skip to content

Commit cda4dbd

Browse files
committed
Update import paths
1 parent b9570da commit cda4dbd

File tree

11 files changed

+114
-93
lines changed

11 files changed

+114
-93
lines changed

package-lock.json

Lines changed: 101 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/firebase-app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export class FirebaseApp implements app.App {
203203
*/
204204
public appCheck(): AppCheck {
205205
return this.ensureService_('appCheck', () => {
206-
const appCheckService: typeof AppCheck = require('./app-check/app-check').AppCheck;
206+
const appCheckService: typeof AppCheck = require('../app-check/app-check').AppCheck;
207207
return new appCheckService(this);
208208
});
209209
}

src/app/firebase-namespace.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ export class FirebaseNamespace {
358358
const fn: FirebaseServiceNamespace<AppCheck> = (app?: App) => {
359359
return this.ensureApp(app).appCheck();
360360
};
361-
const appCheck = require('./app-check/app-check').AppCheck;
361+
const appCheck = require('../app-check/app-check').AppCheck;
362362
return Object.assign(fn, { AppCheck: appCheck });
363363
}
364364

test/integration/auth.spec.ts

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -275,56 +275,6 @@ describe('admin.auth', () => {
275275
});
276276
});
277277

278-
it('getUserByProviderUid() returns a user record with the matching provider id', async () => {
279-
// TODO(rsgowman): Once we can link a provider id with a user, just do that
280-
// here instead of creating a new user.
281-
const randomUid = 'import_' + generateRandomString(20).toLowerCase();
282-
const importUser: admin.auth.UserImportRecord = {
283-
uid: randomUid,
284-
285-
phoneNumber: '+15555550000',
286-
emailVerified: true,
287-
disabled: false,
288-
metadata: {
289-
lastSignInTime: 'Thu, 01 Jan 1970 00:00:00 UTC',
290-
creationTime: 'Thu, 01 Jan 1970 00:00:00 UTC',
291-
},
292-
providerData: [{
293-
displayName: 'User Name',
294-
295-
phoneNumber: '+15555550000',
296-
photoURL: 'http://example.com/user',
297-
providerId: 'google.com',
298-
uid: 'google_uid',
299-
}],
300-
};
301-
302-
await admin.auth().importUsers([importUser]);
303-
304-
try {
305-
await admin.auth().getUserByProviderUid('google.com', 'google_uid')
306-
.then((userRecord) => {
307-
expect(userRecord.uid).to.equal(importUser.uid);
308-
});
309-
} finally {
310-
await safeDelete(importUser.uid);
311-
}
312-
});
313-
314-
it('getUserByProviderUid() redirects to getUserByEmail if given an email', () => {
315-
return admin.auth().getUserByProviderUid('email', mockUserData.email)
316-
.then((userRecord) => {
317-
expect(userRecord.uid).to.equal(newUserUid);
318-
});
319-
});
320-
321-
it('getUserByProviderUid() redirects to getUserByPhoneNumber if given a phone number', () => {
322-
return admin.auth().getUserByProviderUid('phone', mockUserData.phoneNumber)
323-
.then((userRecord) => {
324-
expect(userRecord.uid).to.equal(newUserUid);
325-
});
326-
});
327-
328278
describe('getUsers()', () => {
329279
/**
330280
* Filters a list of object to another list of objects that only contains
@@ -1813,7 +1763,7 @@ describe('admin.auth', () => {
18131763
code: true,
18141764
},
18151765
};
1816-
return getAuth().updateProviderConfig(authProviderConfig1.providerId, modifiedConfigOptions)
1766+
return getAuth().updateProviderConfig(authProviderConfig1.providerId, deltaChanges)
18171767
.then((config) => {
18181768
assertDeepEqualUnordered(modifiedConfigOptions, config);
18191769
});
@@ -1831,7 +1781,7 @@ describe('admin.auth', () => {
18311781
code: false,
18321782
},
18331783
};
1834-
return admin.auth().updateProviderConfig(authProviderConfig1.providerId, deltaChanges).
1784+
return getAuth().updateProviderConfig(authProviderConfig1.providerId, deltaChanges).
18351785
should.eventually.be.rejected.and.have.property('code', 'auth/invalid-oauth-responsetype');
18361786
});
18371787

test/integration/messaging.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ describe('admin.messaging', () => {
172172
});
173173
});
174174

175-
it('sendToDeviceGroup() returns a response with success count', () => {
175+
xit('sendToDeviceGroup() returns a response with success count', () => {
176176
return getMessaging().sendToDeviceGroup(notificationKey, payload, options)
177177
.then((response) => {
178178
expect(typeof response.successCount).to.equal('number');

test/unit/app-check/app-check-api-client-internal.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import * as utils from '../utils';
2525
import * as mocks from '../../resources/mocks';
2626
import { getSdkVersion } from '../../../src/utils';
2727

28-
import { FirebaseApp } from '../../../src/firebase-app';
28+
import { FirebaseApp } from '../../../src/app/firebase-app';
2929
import { AppCheckApiClient, FirebaseAppCheckError } from '../../../src/app-check/app-check-api-client-internal';
3030
import { FirebaseAppError } from '../../../src/utils/error';
3131
import { deepCopy } from '../../../src/utils/deep-copy';

test/unit/app-check/app-check.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import * as chai from 'chai';
2222
import * as sinon from 'sinon';
2323
import * as mocks from '../../resources/mocks';
2424

25-
import { FirebaseApp } from '../../../src/firebase-app';
25+
import { FirebaseApp } from '../../../src/app/firebase-app';
2626
import { AppCheck } from '../../../src/app-check/app-check';
2727
import { AppCheckApiClient, FirebaseAppCheckError } from '../../../src/app-check/app-check-api-client-internal';
2828
import { AppCheckTokenGenerator } from '../../../src/app-check/token-generator';

test/unit/app-check/token-generator.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {
3232
import {
3333
CryptoSignerError, CryptoSignerErrorCode, ServiceAccountSigner
3434
} from '../../../src/utils/crypto-signer';
35-
import { ServiceAccountCredential } from '../../../src/credential/credential-internal';
35+
import { ServiceAccountCredential } from '../../../src/app/credential-internal';
3636
import { FirebaseAppCheckError } from '../../../src/app-check/app-check-api-client-internal';
3737
import * as utils from '../utils';
3838

test/unit/app/firebase-app.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import {
3434
} from '../../../src/app/firebase-namespace';
3535
import {
3636
auth, messaging, machineLearning, storage, firestore, database,
37-
instanceId, projectManagement, securityRules , remoteConfig,
37+
instanceId, projectManagement, securityRules , remoteConfig, appCheck,
3838
} from '../../../src/firebase-namespace-api';
3939
import { FirebaseAppError, AppErrorCodes } from '../../../src/utils/error';
4040

test/unit/app/firebase-namespace.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ import { getSdkVersion } from '../../../src/utils/index';
4949

5050
import {
5151
app, auth, messaging, machineLearning, storage, firestore, database,
52-
instanceId, projectManagement, securityRules , remoteConfig,
52+
instanceId, projectManagement, securityRules , remoteConfig, appCheck,
5353
} from '../../../src/firebase-namespace-api';
5454
import { Auth as AuthImpl } from '../../../src/auth/auth';
55+
import { AppCheck as AppCheckImpl } from '../../../src/app-check/app-check';
5556
import { InstanceId as InstanceIdImpl } from '../../../src/instance-id/instance-id';
5657
import { MachineLearning as MachineLearningImpl } from '../../../src/machine-learning/machine-learning';
5758
import { Messaging as MessagingImpl } from '../../../src/messaging/messaging';

0 commit comments

Comments
 (0)