Skip to content

[Auth] Add compat integration tests to CI #5158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages-exp/auth-compat-exp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
"build:release": "rollup -c rollup.config.release.js && yarn add-compat-overloads",
"dev": "rollup -c -w",
"test": "run-p lint test:all",
"test:all": "run-p test:browser test:node",
"test:all": "run-p test:browser test:node test:integration",
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
"test:browser": "karma start --single-run",
"test:browser:integration": "karma start --single-run --integration",
"test:node": "ts-node -O '{\"module\": \"commonjs\", \"target\": \"es6\"}' scripts/run_node_tests.ts",
"test:node:integration": "ts-node -O '{\"module\": \"commonjs\", \"target\": \"es6\"}' scripts/run_node_tests.ts --integration",
"test:webdriver": "rollup -c test/integration/webdriver/static/rollup.config.js && ts-node -O '{\"module\": \"commonjs\", \"target\": \"es6\"}' scripts/run_node_tests.ts --webdriver",
"test:integration": "run-s test:browser:integration test:node:integration test:webdriver",
"test:integration": "firebase emulators:exec --project demo-emulatedproject --only auth \"run-s test:browser:integration test:node:integration test:webdriver\"",
"add-compat-overloads": "ts-node-script ../../scripts/exp/create-overloads.ts -i ../auth-exp/dist/auth-exp-public.d.ts -o dist/auth-compat-exp/index.d.ts -a -r Auth:types.FirebaseAuth -r User:types.User -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/auth"
},
"peerDependencies": {
Expand Down Expand Up @@ -65,4 +65,4 @@
"reportDir": "./coverage/node"
},
"esm5": "dist/index.esm.js"
}
}
4 changes: 3 additions & 1 deletion packages-exp/auth-compat-exp/src/phone_auth_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ import * as exp from '@firebase/auth-exp/internal';
import * as compat from '@firebase/auth-types';
import firebase from '@firebase/app-compat';
import { Compat } from '@firebase/util';
import { unwrap } from './wrap';

export class PhoneAuthProvider
implements compat.PhoneAuthProvider, Compat<exp.PhoneAuthProvider> {
implements compat.PhoneAuthProvider, Compat<exp.PhoneAuthProvider>
{
providerId = 'phone';
readonly _delegate: exp.PhoneAuthProvider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ window.legacyAuth = null;
// calls this function after that injection.
window.startAuth = async () => {
// Make sure we haven't confused our firebase with the old firebase
if (!firebase.SDK_VERSION.startsWith('0.9')) {
if (!firebase.SDK_VERSION.startsWith('9.')) {
throw new Error(
'Using legacy SDK version instead of compat version ' +
firebase.SDK_VERSION
Expand Down