mirror of
https://github.com/hanzoai/firebase-js-sdk.git
synced 2026-09-24 16:59:10 +00:00
* Add linkDomain field to ActionCodeSettings (#8428) * Add linkDomain field to ActionCodeSettings * Update API reports * Update error message for ERROR_INVALID_HOSTING_LINK_DOMAIN to include that default hosting domains cannot be used. * Use constants for test values --------- Co-authored-by: NhienLam <[email protected]> * FDL Deprecation & Hosting link Integration Test (#8603) * Implement Integration test for passwordless email sign-in via firebase-hosting links. * Add license to new test file created' did not match any files * Remove unwanted _ * Add support for setting custom hosting link domain in test app (#8614) * Add afterEach method and apply formatting to the hosting links integration test (#8615) * Mark ActionCodeSettings.dynamicLinkDomain as deprecated * Add changeset * Update API reports * Address review comments * Fix changeset * Update refdocs and address review comments * Update deprecated comment * Add FDL deprecation FAQ link * Fix linkDomain link in refdocs --------- Co-authored-by: NhienLam <[email protected]> Co-authored-by: mansisampat <[email protected]>
98 lines
2.9 KiB
JavaScript
98 lines
2.9 KiB
JavaScript
/**
|
|
* @license
|
|
* Copyright 2019 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
const karmaBase = require('../../config/karma.base');
|
|
const webpackBase = require('../../config/webpack.test');
|
|
const { argv } = require('yargs');
|
|
|
|
module.exports = function (config) {
|
|
const karmaConfig = Object.assign({}, karmaBase, {
|
|
browsers: getTestBrowsers(argv),
|
|
// files to load into karma
|
|
files: getTestFiles(argv),
|
|
// frameworks to use
|
|
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
|
frameworks: ['mocha'],
|
|
client: Object.assign({}, karmaBase.client, getClientConfig(argv))
|
|
});
|
|
|
|
config.set(karmaConfig);
|
|
};
|
|
|
|
function getTestFiles(argv) {
|
|
if (argv.unit) {
|
|
return ['src/**/*.test.ts', 'test/helpers/**/*.test.ts'];
|
|
} else if (argv.integration) {
|
|
if (argv.prodbackend) {
|
|
return [
|
|
'test/integration/flows/totp.test.ts',
|
|
'test/integration/flows/password_policy.test.ts',
|
|
'test/integration/flows/recaptcha_enterprise.test.ts',
|
|
'test/integration/flows/hosting_link.test.ts'
|
|
];
|
|
}
|
|
return argv.local
|
|
? ['test/integration/flows/*.test.ts']
|
|
: ['test/integration/flows/*!(local).test.ts'];
|
|
} else if (argv.cordova) {
|
|
return ['src/platform_cordova/**/*.test.ts'];
|
|
} else {
|
|
// For the catch-all yarn:test, ignore the phone integration test
|
|
return [
|
|
'src/**/*.test.ts',
|
|
'test/helpers/**/*.test.ts',
|
|
'test/integration/flows/anonymous.test.ts',
|
|
'test/integration/flows/email.test.ts',
|
|
'test/integration/flows/firebaseserverapp.test.ts'
|
|
];
|
|
}
|
|
}
|
|
|
|
function getTestBrowsers(argv) {
|
|
let browsers = ['ChromeHeadless'];
|
|
if (process.env?.BROWSERS && argv.unit) {
|
|
browsers = process.env?.BROWSERS?.split(',');
|
|
}
|
|
return browsers;
|
|
}
|
|
|
|
function getClientConfig(argv) {
|
|
if (!argv.local) {
|
|
return {};
|
|
}
|
|
|
|
if (!process.env.GCLOUD_PROJECT || !process.env.FIREBASE_AUTH_EMULATOR_HOST) {
|
|
console.error(
|
|
'Local testing against emulator requested, but ' +
|
|
'GCLOUD_PROJECT and FIREBASE_AUTH_EMULATOR_HOST env variables ' +
|
|
'are missing'
|
|
);
|
|
process.exit(1);
|
|
}
|
|
|
|
return {
|
|
authAppConfig: {
|
|
apiKey: 'local-api-key',
|
|
projectId: process.env.GCLOUD_PROJECT,
|
|
authDomain: 'local-auth-domain'
|
|
},
|
|
authEmulatorHost: process.env.FIREBASE_AUTH_EMULATOR_HOST
|
|
};
|
|
}
|
|
|
|
module.exports.files = getTestFiles(argv);
|