Skip to content

Commit 2807620

Browse files
committed
Fix failing auth compat tests (#3783)
* Fix the auth compat 'tests' * Formatting * Fix integration test * Formatting
1 parent a5c44c5 commit 2807620

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed

packages-exp/auth-compat-exp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"test:all": "run-p test:browser test:node",
2222
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
2323
"test:browser": "karma start --single-run",
24-
"test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha src/**/*.test.* --opts ../../config/mocha.node.opts",
24+
"test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha src/**/*.test.* --config ../../config/mocharc.node.js",
2525
"prepare": "yarn build"
2626
},
2727
"peerDependencies": {
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* @license
3+
* Copyright 2020 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
describe('auth-compat', () => {
19+
it('nothing here yet', () => {
20+
// TODO: write tests after the refactor
21+
});
22+
});

packages-exp/auth-exp/test/integration/flows/phone.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import {
2727
signInWithPhoneNumber,
2828
unlink,
2929
updatePhoneNumber
30-
// eslint-disable-next-line import/no-extraneous-dependencies
3130
} from '@firebase/auth-exp';
3231
import {
3332
Auth,
@@ -174,7 +173,7 @@ describe('Integration test: phone auth', () => {
174173
it('allows the user to reauthenticate with phone number', async () => {
175174
let cr = await signInWithPhoneNumber(auth, PHONE_A.phoneNumber, verifier);
176175
const { user } = await cr.confirm(PHONE_A.code);
177-
const oldToken = user.refreshToken;
176+
const oldToken = await user.getIdToken();
178177

179178
resetVerifier();
180179

@@ -185,7 +184,7 @@ describe('Integration test: phone auth', () => {
185184
);
186185
await cr.confirm(PHONE_A.code);
187186

188-
expect(user.refreshToken).not.to.eq(oldToken);
187+
expect(await user.getIdToken()).not.to.eq(oldToken);
189188
});
190189

191190
it('prevents reauthentication with wrong phone number', async () => {

0 commit comments

Comments
 (0)