Skip to content

Commit 1b9494b

Browse files
committed
PR feedback
1 parent fa7abda commit 1b9494b

32 files changed

+91
-99
lines changed

packages-exp/auth-exp/src/api/account_management/account.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { FirebaseError } from '@firebase/util';
2323

2424
import { Endpoint } from '../';
2525
import { mockEndpoint } from '../../../test/api/helper';
26-
import { testEnvironment } from '../../../test/mock_auth';
26+
import { testAuth } from '../../../test/mock_auth';
2727
import * as mockFetch from '../../../test/mock_fetch';
2828
import { Auth } from '../../model/auth';
2929
import { ServerError } from '../errors';
@@ -39,7 +39,7 @@ describe('api/account_management/deleteAccount', () => {
3939
let auth: Auth;
4040

4141
beforeEach(async () => {
42-
auth = (await testEnvironment()).auth;
42+
auth = await testAuth();
4343
mockFetch.setUp();
4444
});
4545

@@ -91,7 +91,7 @@ describe('api/account_management/deleteLinkedAccounts', () => {
9191
let auth: Auth;
9292

9393
beforeEach(async () => {
94-
auth = (await testEnvironment()).auth;
94+
auth = await testAuth();
9595
mockFetch.setUp();
9696
});
9797

@@ -151,10 +151,10 @@ describe('api/account_management/getAccountInfo', () => {
151151
let auth: Auth;
152152

153153
beforeEach(async () => {
154-
auth = (await testEnvironment()).auth;
154+
auth = await testAuth();
155155
mockFetch.setUp();
156156
});
157-
157+
158158
afterEach(mockFetch.tearDown);
159159

160160
it('should POST to the correct endpoint', async () => {

packages-exp/auth-exp/src/api/account_management/email_and_password.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { FirebaseError } from '@firebase/util';
2222

2323
import { Endpoint } from '../';
2424
import { mockEndpoint } from '../../../test/api/helper';
25-
import { testEnvironment } from '../../../test/mock_auth';
25+
import { testAuth } from '../../../test/mock_auth';
2626
import * as mockFetch from '../../../test/mock_fetch';
2727
import { Auth } from '../../model/auth';
2828
import { ServerError } from '../errors';
@@ -39,7 +39,7 @@ describe('api/account_management/resetPassword', () => {
3939
let auth: Auth;
4040

4141
beforeEach(async () => {
42-
auth = (await testEnvironment()).auth;
42+
auth = await testAuth();
4343
mockFetch.setUp();
4444
});
4545

@@ -96,7 +96,7 @@ describe('api/account_management/updateEmailPassword', () => {
9696
let auth: Auth;
9797

9898
beforeEach(async () => {
99-
auth = (await testEnvironment()).auth;
99+
auth = await testAuth();
100100
mockFetch.setUp();
101101
});
102102

packages-exp/auth-exp/src/api/account_management/mfa.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { FirebaseError } from '@firebase/util';
2222

2323
import { Endpoint } from '../';
2424
import { mockEndpoint } from '../../../test/api/helper';
25-
import { testEnvironment } from '../../../test/mock_auth';
25+
import { testAuth } from '../../../test/mock_auth';
2626
import * as mockFetch from '../../../test/mock_fetch';
2727
import { Auth } from '../../model/auth';
2828
import { ServerError } from '../errors';
@@ -42,7 +42,7 @@ describe('api/account_management/startEnrollPhoneMfa', () => {
4242
let auth: Auth;
4343

4444
beforeEach(async () => {
45-
auth = (await testEnvironment()).auth;
45+
auth = await testAuth();
4646
mockFetch.setUp();
4747
});
4848

@@ -103,7 +103,7 @@ describe('api/account_management/enrollPhoneMfa', () => {
103103
let auth: Auth;
104104

105105
beforeEach(async () => {
106-
auth = (await testEnvironment()).auth;
106+
auth = await testAuth();
107107
mockFetch.setUp();
108108
});
109109

@@ -160,10 +160,10 @@ describe('api/account_management/withdrawMfa', () => {
160160
let auth: Auth;
161161

162162
beforeEach(async () => {
163-
auth = (await testEnvironment()).auth;
163+
auth = await testAuth();
164164
mockFetch.setUp();
165165
});
166-
166+
167167
afterEach(mockFetch.tearDown);
168168

169169
it('should POST to the correct endpoint', async () => {

packages-exp/auth-exp/src/api/account_management/profile.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { FirebaseError } from '@firebase/util';
2222

2323
import { Endpoint } from '../';
2424
import { mockEndpoint } from '../../../test/api/helper';
25-
import { testEnvironment } from '../../../test/mock_auth';
25+
import { testAuth } from '../../../test/mock_auth';
2626
import * as mockFetch from '../../../test/mock_fetch';
2727
import { Auth } from '../../model/auth';
2828
import { ServerError } from '../errors';
@@ -40,7 +40,7 @@ describe('api/account_management/updateProfile', () => {
4040
let auth: Auth;
4141

4242
beforeEach(async () => {
43-
auth = (await testEnvironment()).auth;
43+
auth = await testAuth();
4444
mockFetch.setUp();
4545
});
4646

packages-exp/auth-exp/src/api/authentication/create_auth_uri.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { FirebaseError } from '@firebase/util';
2222

2323
import { Endpoint } from '../';
2424
import { mockEndpoint } from '../../../test/api/helper';
25-
import { testEnvironment } from '../../../test/mock_auth';
25+
import { testAuth } from '../../../test/mock_auth';
2626
import * as mockFetch from '../../../test/mock_fetch';
2727
import { Auth } from '../../model/auth';
2828
import { ServerError } from '../errors';
@@ -39,7 +39,7 @@ describe('api/authentication/createAuthUri', () => {
3939
let auth: Auth;
4040

4141
beforeEach(async () => {
42-
auth = (await testEnvironment()).auth;
42+
auth = await testAuth();
4343
mockFetch.setUp();
4444
});
4545

packages-exp/auth-exp/src/api/authentication/custom_token.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { FirebaseError } from '@firebase/util';
2323

2424
import { Endpoint } from '../';
2525
import { mockEndpoint } from '../../../test/api/helper';
26-
import { testEnvironment } from '../../../test/mock_auth';
26+
import { testAuth } from '../../../test/mock_auth';
2727
import * as mockFetch from '../../../test/mock_fetch';
2828
import { Auth } from '../../model/auth';
2929
import { ServerError } from '../errors';
@@ -39,7 +39,7 @@ describe('api/authentication/signInWithCustomToken', () => {
3939
let auth: Auth;
4040

4141
beforeEach(async () => {
42-
auth = (await testEnvironment()).auth;
42+
auth = await testAuth();
4343
mockFetch.setUp();
4444
});
4545

packages-exp/auth-exp/src/api/authentication/email_and_password.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { FirebaseError } from '@firebase/util';
2222

2323
import { Endpoint } from '../';
2424
import { mockEndpoint } from '../../../test/api/helper';
25-
import { testEnvironment } from '../../../test/mock_auth';
25+
import { testAuth } from '../../../test/mock_auth';
2626
import * as mockFetch from '../../../test/mock_fetch';
2727
import { Operation } from '../../model/action_code_info';
2828
import { Auth } from '../../model/auth';
@@ -44,7 +44,7 @@ describe('api/authentication/signInWithPassword', () => {
4444
let auth: Auth;
4545

4646
beforeEach(async () => {
47-
auth = (await testEnvironment()).auth;
47+
auth = await testAuth();
4848
mockFetch.setUp();
4949
});
5050

@@ -101,7 +101,7 @@ describe('api/authentication/sendEmailVerification', () => {
101101
let auth: Auth;
102102

103103
beforeEach(async () => {
104-
auth = (await testEnvironment()).auth;
104+
auth = await testAuth();
105105
mockFetch.setUp();
106106
});
107107

@@ -156,7 +156,7 @@ describe('api/authentication/sendPasswordResetEmail', () => {
156156
let auth: Auth;
157157

158158
beforeEach(async () => {
159-
auth = (await testEnvironment()).auth;
159+
auth = await testAuth();
160160
mockFetch.setUp();
161161
});
162162

@@ -211,7 +211,7 @@ describe('api/authentication/sendSignInLinkToEmail', () => {
211211
let auth: Auth;
212212

213213
beforeEach(async () => {
214-
auth = (await testEnvironment()).auth;
214+
auth = await testAuth();
215215
mockFetch.setUp();
216216
});
217217

packages-exp/auth-exp/src/api/authentication/email_link.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { FirebaseError } from '@firebase/util';
2222

2323
import { Endpoint } from '../';
2424
import { mockEndpoint } from '../../../test/api/helper';
25-
import { testEnvironment } from '../../../test/mock_auth';
25+
import { testAuth } from '../../../test/mock_auth';
2626
import * as mockFetch from '../../../test/mock_fetch';
2727
import { Auth } from '../../model/auth';
2828
import { ServerError } from '../errors';
@@ -39,7 +39,7 @@ describe('api/authentication/signInWithEmailLink', () => {
3939
let auth: Auth;
4040

4141
beforeEach(async () => {
42-
auth = (await testEnvironment()).auth;
42+
auth = await testAuth();
4343
mockFetch.setUp();
4444
});
4545

packages-exp/auth-exp/src/api/authentication/idp.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { FirebaseError } from '@firebase/util';
2222

2323
import { Endpoint } from '../';
2424
import { mockEndpoint } from '../../../test/api/helper';
25-
import { testEnvironment } from '../../../test/mock_auth';
25+
import { testAuth } from '../../../test/mock_auth';
2626
import * as mockFetch from '../../../test/mock_fetch';
2727
import { Auth } from '../../model/auth';
2828
import { ServerError } from '../errors';
@@ -40,7 +40,7 @@ describe('api/authentication/signInWithIdp', () => {
4040
let auth: Auth;
4141

4242
beforeEach(async () => {
43-
auth = (await testEnvironment()).auth;
43+
auth = await testAuth();
4444
mockFetch.setUp();
4545
});
4646

packages-exp/auth-exp/src/api/authentication/mfa.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { FirebaseError } from '@firebase/util';
2222

2323
import { Endpoint } from '../';
2424
import { mockEndpoint } from '../../../test/api/helper';
25-
import { testEnvironment } from '../../../test/mock_auth';
25+
import { testAuth } from '../../../test/mock_auth';
2626
import * as mockFetch from '../../../test/mock_fetch';
2727
import { Auth } from '../../model/auth';
2828
import { ServerError } from '../errors';
@@ -42,7 +42,7 @@ describe('api/authentication/startSignInPhoneMfa', () => {
4242
let auth: Auth;
4343

4444
beforeEach(async () => {
45-
auth = (await testEnvironment()).auth;
45+
auth = await testAuth();
4646
mockFetch.setUp();
4747
});
4848

@@ -104,7 +104,7 @@ describe('api/authentication/finalizeSignInPhoneMfa', () => {
104104
let auth: Auth;
105105

106106
beforeEach(async () => {
107-
auth = (await testEnvironment()).auth;
107+
auth = await testAuth();
108108
mockFetch.setUp();
109109
});
110110

packages-exp/auth-exp/src/api/authentication/recaptcha.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { FirebaseError } from '@firebase/util';
2222

2323
import { Endpoint } from '../';
2424
import { mockEndpoint } from '../../../test/api/helper';
25-
import { testEnvironment } from '../../../test/mock_auth';
25+
import { testAuth } from '../../../test/mock_auth';
2626
import * as mockFetch from '../../../test/mock_fetch';
2727
import { Auth } from '../../model/auth';
2828
import { ServerError } from '../errors';
@@ -34,7 +34,7 @@ describe('api/authentication/getRecaptchaParams', () => {
3434
let auth: Auth;
3535

3636
beforeEach(async () => {
37-
auth = (await testEnvironment()).auth;
37+
auth = await testAuth();
3838
mockFetch.setUp();
3939
});
4040

packages-exp/auth-exp/src/api/authentication/sign_up.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { FirebaseError } from '@firebase/util';
2222

2323
import { Endpoint } from '../';
2424
import { mockEndpoint } from '../../../test/api/helper';
25-
import { testEnvironment } from '../../../test/mock_auth';
25+
import { testAuth } from '../../../test/mock_auth';
2626
import * as mockFetch from '../../../test/mock_fetch';
2727
import { Auth } from '../../model/auth';
2828
import { ServerError } from '../errors';
@@ -40,7 +40,7 @@ describe('api/authentication/signUp', () => {
4040
let auth: Auth;
4141

4242
beforeEach(async () => {
43-
auth = (await testEnvironment()).auth;
43+
auth = await testAuth();
4444
mockFetch.setUp();
4545
});
4646

packages-exp/auth-exp/src/api/authentication/sms.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { FirebaseError } from '@firebase/util';
2323

2424
import { Endpoint } from '../';
2525
import { mockEndpoint } from '../../../test/api/helper';
26-
import { testEnvironment } from '../../../test/mock_auth';
26+
import { testAuth } from '../../../test/mock_auth';
2727
import * as mockFetch from '../../../test/mock_fetch';
2828
import { Auth } from '../../model/auth';
2929
import { ServerError } from '../errors';
@@ -43,7 +43,7 @@ describe('api/authentication/sendPhoneVerificationCode', () => {
4343
let auth: Auth;
4444

4545
beforeEach(async () => {
46-
auth = (await testEnvironment()).auth;
46+
auth = await testAuth();
4747
mockFetch.setUp();
4848
});
4949

@@ -102,7 +102,7 @@ describe('api/authentication/signInWithPhoneNumber', () => {
102102
let auth: Auth;
103103

104104
beforeEach(async () => {
105-
auth = (await testEnvironment()).auth;
105+
auth = await testAuth();
106106
mockFetch.setUp();
107107
});
108108

@@ -167,7 +167,7 @@ describe('api/authentication/linkWithPhoneNumber', () => {
167167
let auth: Auth;
168168

169169
beforeEach(async () => {
170-
auth = (await testEnvironment()).auth;
170+
auth = await testAuth();
171171
mockFetch.setUp();
172172
});
173173

@@ -231,7 +231,7 @@ describe('api/authentication/verifyPhoneNumberForExisting', () => {
231231
let auth: Auth;
232232

233233
beforeEach(async () => {
234-
auth = (await testEnvironment()).auth;
234+
auth = await testAuth();
235235
mockFetch.setUp();
236236
});
237237

packages-exp/auth-exp/src/api/authentication/token.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import * as chaiAsPromised from 'chai-as-promised';
2020

2121
import { FirebaseError, querystringDecode } from '@firebase/util';
2222

23-
import { testEnvironment } from '../../../test/mock_auth';
23+
import { testAuth } from '../../../test/mock_auth';
2424
import * as fetch from '../../../test/mock_fetch';
2525
import { Auth } from '../../model/auth';
2626
import { ServerError } from '../errors';
@@ -33,7 +33,7 @@ describe('requestStsToken', () => {
3333
let endpoint: string;
3434

3535
beforeEach(async () => {
36-
auth = (await testEnvironment()).auth;
36+
auth = await testAuth();
3737
const { apiKey, tokenApiHost, apiScheme } = auth.config;
3838
endpoint = `${apiScheme}://${tokenApiHost}/${_ENDPOINT}?key=${apiKey}`;
3939
fetch.setUp();

packages-exp/auth-exp/src/api/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { SinonStub, stub, useFakeTimers } from 'sinon';
2222
import { FirebaseError } from '@firebase/util';
2323

2424
import { mockEndpoint } from '../../test/api/helper';
25-
import { testEnvironment } from '../../test/mock_auth';
25+
import { testAuth } from '../../test/mock_auth';
2626
import * as mockFetch from '../../test/mock_fetch';
2727
import { AuthErrorCode } from '../core/errors';
2828
import { Auth } from '../model/auth';
@@ -43,7 +43,7 @@ describe('api/_performApiRequest', () => {
4343
let auth: Auth;
4444

4545
beforeEach(async () => {
46-
auth = (await testEnvironment()).auth;
46+
auth = await testAuth();
4747
});
4848

4949
context('with regular requests', () => {

0 commit comments

Comments
 (0)