Skip to content
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

#4953 Use test replaceable port #5887

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class EncryptedMsgMailFormatter extends BaseMailFormatter {
const pubkeyMsgData = {
...newMsg,
recipients: pubkeyRecipients,
// brackets are required for test emails like '@test:8001'
// brackets are required for test emails like '@test:{port}'
replyTo: replyToForMessageSentToPubkeyRecipients.length
? Str.formatEmailList([newMsg.from, ...replyToForMessageSentToPubkeyRecipients], true)
: undefined,
Expand Down
3 changes: 2 additions & 1 deletion extension/js/common/core/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import { base64decode, base64encode } from '../platform/util.js';
import { Xss } from '../platform/xss.js';
import { Buf } from './buf.js';
import { MOCK_PORT } from './const.js';
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed

export type Dict<T> = { [key: string]: T };
export type UrlParam = string | number | null | undefined | boolean | string[];
Expand Down Expand Up @@ -159,7 +160,7 @@ export class Str {
if (email.includes(' ')) {
return false;
}
email = email.replace(/\:8001$/, ''); // for MOCK tests, todo: remove from production
email = email.replace(new RegExp(`:${MOCK_PORT}$`), ''); // for MOCK tests, todo: remove from production
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it still used or we can remove this replacement?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it is still used but let me check again

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked and this logic is still used

// `localhost` is a valid top-level domain for an email address, otherwise we require a second-level domain to be present
return /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|localhost|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i.test(
email
Expand Down
1 change: 1 addition & 0 deletions extension/js/common/core/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const BACKEND_API_HOST = '[BUILD_REPLACEABLE_BACKEND_API_HOST]';
export const ATTESTER_API_HOST = '[BUILD_REPLACEABLE_ATTESTER_API_HOST]';
export const SHARED_TENANT_API_HOST = '[BUILD_REPLACEABLE_SHARED_TENANT_API_HOST]';
export const KEYS_OPENPGP_ORG_API_HOST = '[BUILD_REPLACEABLE_KEYS_OPENPGP_ORG_API_HOST]';
export const MOCK_PORT = '[TEST_REPLACEABLE_MOCK_PORT]';
export const WKD_API_HOST = ''; // empty means choose host per recipient domain

/**
Expand Down
2 changes: 1 addition & 1 deletion scripts/config-mock-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
BUILD_PATH=./build/test/mock-builds/port-$2-$(openssl rand -hex 12)
mkdir -p $BUILD_PATH
cp -r ./$1/* $BUILD_PATH
grep ":8001" $BUILD_PATH -lr | xargs sed -i.bak -e "s/\:8001/\:$2/g"
grep "\[TEST_REPLACEABLE_MOCK_PORT\]" $BUILD_PATH -lr | xargs sed -i.bak -e "s/\[TEST_REPLACEABLE_MOCK_PORT\]/$2/g"
echo $BUILD_PATH
16 changes: 8 additions & 8 deletions test/source/mock/fes/customer-url-fes-endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const getMockCustomerUrlFesEndpoints = (config: FesConfig | undefined): H
'/api/v1/message/FES-MOCK-EXTERNAL-ID/gateway': async ({ body }, req) => {
const port = parsePort(req);
if (parseAuthority(req) === standardFesUrl(port) && req.method === 'POST') {
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal`
// test: `compose - [email protected]:{port} - PWD encrypted message with FES web portal`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's just remove :{port} from tests names, so it'll be compose - [email protected] - PWD encrypted message with FES web portal, same for other tests

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good!

authenticate(req, isCustomIDPUsed);
expect(body).to.match(messageIdRegex(port));
return {};
Expand All @@ -90,7 +90,7 @@ export const getMockCustomerUrlFesEndpoints = (config: FesConfig | undefined): H
'/api/v1/message/[email protected]/gateway': async ({ body }, req) => {
const port = parsePort(req);
if (parseAuthority(req) === standardFesUrl(port) && req.method === 'POST') {
// test: `compose - [email protected]:8001 - PWD encrypted message with FES - Reply rendering`
// test: `compose - [email protected]:{port} - PWD encrypted message with FES - Reply rendering`
authenticate(req, isCustomIDPUsed);
expect(body).to.match(messageIdRegex(port));
return {};
Expand All @@ -100,10 +100,10 @@ export const getMockCustomerUrlFesEndpoints = (config: FesConfig | undefined): H
'/api/v1/message/[email protected]/gateway': async ({ body }, req) => {
const port = parsePort(req);
if (parseAuthority(req) === standardFesUrl(port) && req.method === 'POST') {
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal`
// test: `compose - [email protected]:8001 - PWD encrypted message with FES - Reply rendering`
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal - pubkey recipient in bcc`
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal - some sends fail with BadRequest error`
// test: `compose - [email protected]:{port} - PWD encrypted message with FES web portal`
// test: `compose - [email protected]:{port} - PWD encrypted message with FES - Reply rendering`
// test: `compose - [email protected]:{port} - PWD encrypted message with FES web portal - pubkey recipient in bcc`
// test: `compose - [email protected]:{port} - PWD encrypted message with FES web portal - some sends fail with BadRequest error`
authenticate(req, isCustomIDPUsed);
expect(body).to.match(messageIdRegex(port));
return {};
Expand All @@ -113,15 +113,15 @@ export const getMockCustomerUrlFesEndpoints = (config: FesConfig | undefined): H
'/api/v1/message/[email protected]/gateway': async ({ body }, req) => {
const port = parsePort(req);
if (parseAuthority(req) === standardFesUrl(port) && req.method === 'POST') {
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal`
// test: `compose - [email protected]:{port} - PWD encrypted message with FES web portal`
authenticate(req, isCustomIDPUsed);
expect(body).to.match(messageIdRegex(port));
return {};
}
throw new HttpClientErr('Not Found', 404);
},
'/api/v1/message/[email protected]/gateway': async () => {
// test: `[email protected]:8001 - PWD encrypted message with FES web portal - a send fails with gateway update error`
// test: `[email protected]:{port} - PWD encrypted message with FES web portal - a send fails with gateway update error`
throw new HttpClientErr(`Test error`, Status.BAD_REQUEST);
},
};
Expand Down
16 changes: 8 additions & 8 deletions test/source/mock/fes/shared-tenant-fes-endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const getMockSharedTenantFesEndpoints = (config: FesConfig | undefined):
},
'/shared-tenant-fes/api/v1/message/FES-MOCK-EXTERNAL-ID/gateway': async ({ body }, req) => {
if (req.method === 'POST') {
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal`
// test: `compose - [email protected]:{port} - PWD encrypted message with FES web portal`
authenticate(req, 'oidc');
expect(body).to.match(messageIdRegexForRequest(req));
return {};
Expand All @@ -168,7 +168,7 @@ export const getMockSharedTenantFesEndpoints = (config: FesConfig | undefined):
},
'/shared-tenant-fes/api/v1/message/[email protected]/gateway': async ({ body }, req) => {
if (req.method === 'POST') {
// test: `compose - [email protected]:8001 - PWD encrypted message with FES - Reply rendering`
// test: `compose - [email protected]:{port} - PWD encrypted message with FES - Reply rendering`
authenticate(req, 'oidc');
expect(body).to.match(messageIdRegexForRequest(req));
return {};
Expand All @@ -177,10 +177,10 @@ export const getMockSharedTenantFesEndpoints = (config: FesConfig | undefined):
},
'/shared-tenant-fes/api/v1/message/[email protected]/gateway': async ({ body }, req) => {
if (req.method === 'POST') {
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal`
// test: `compose - [email protected]:8001 - PWD encrypted message with FES - Reply rendering`
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal - pubkey recipient in bcc`
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal - some sends fail with BadRequest error`
// test: `compose - [email protected]:{port} - PWD encrypted message with FES web portal`
// test: `compose - [email protected]:{port} - PWD encrypted message with FES - Reply rendering`
// test: `compose - [email protected]:{port} - PWD encrypted message with FES web portal - pubkey recipient in bcc`
// test: `compose - [email protected]:{port} - PWD encrypted message with FES web portal - some sends fail with BadRequest error`
authenticate(req, 'oidc');
expect(body).to.match(messageIdRegexForRequest(req));
return {};
Expand All @@ -189,15 +189,15 @@ export const getMockSharedTenantFesEndpoints = (config: FesConfig | undefined):
},
'/shared-tenant-fes/api/v1/message/[email protected]/gateway': async ({ body }, req) => {
if (req.method === 'POST') {
// test: `compose - [email protected]:8001 - PWD encrypted message with FES web portal`
// test: `compose - [email protected]:{port} - PWD encrypted message with FES web portal`
authenticate(req, 'oidc');
expect(body).to.match(messageIdRegexForRequest(req));
return {};
}
throw new HttpClientErr('Not Found', 404);
},
'/shared-tenant-fes/api/v1/message/[email protected]/gateway': async () => {
// test: `[email protected]:8001 - PWD encrypted message with FES web portal - a send fails with gateway update error`
// test: `[email protected]:{port} - PWD encrypted message with FES web portal - a send fails with gateway update error`
throw new HttpClientErr(`Test error`, Status.BAD_REQUEST);
},
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"acctEmail": "[email protected]:8001",
"acctEmail": "[email protected]:{port}",
"full": {
"id": "1803be3182d1937b",
"threadId": "1803be2e506153d2",
Expand Down
3 changes: 2 additions & 1 deletion test/source/mock/lib/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { HttpClientErr, Status } from './api';
import { Buf } from '../../core/buf';
import { Str } from '../../core/common';
import { issuedCustomIDPIdTokens, issuedGoogleIDPIdTokens } from '../fes/customer-url-fes-endpoints';
import { MOCK_PORT } from '../../core/const';

const authURL = 'https://localhost:8001';
const authURL = `https://localhost:${MOCK_PORT}`;

export class OauthMock {
public static customIDPClientId = 'custom-test-idp-client-id';
Expand Down
5 changes: 4 additions & 1 deletion test/source/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { BrowserHandle, BrowserPool } from './browser';
import { AvaContext, TestContext, getDebugHtmlAtts, minutes, standaloneTestTimeout } from './tests/tooling';
import { Util, getParsedCliParams } from './util';

import { mkdirSync, realpathSync, writeFileSync } from 'fs';
import { mkdirSync, readFileSync, realpathSync, writeFileSync } from 'fs';
import { TestUrls } from './browser/test-urls';
import { startAllApisMock } from './mock/all-apis-mock';
import { defineComposeTests } from './tests/compose';
Expand Down Expand Up @@ -106,7 +106,10 @@ const startMockApiAndCopyBuild = async (t: AvaContext) => {
const address = mockApi.server.address();
if (typeof address === 'object' && address) {
const result = await asyncExec(`sh ./scripts/config-mock-build.sh ${buildDir} ${address.port}`);
const filepath = `${buildDir}/js/common/core/const.js`;

const updatedCode = readFileSync(filepath, { encoding: 'utf-8' }).replace(/const (MOCK_PORT) = [^;]+;/g, `const $1 = '${address.port}';`);
writeFileSync(filepath, updatedCode);
t.context.extensionDir = result.stdout;
t.context.urls = new TestUrls(await browserPool.getExtensionId(t), address.port);
} else {
Expand Down
6 changes: 3 additions & 3 deletions test/source/tests/browser-unit-tests/unit-Sks.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
BROWSER_UNIT_TEST_NAME(`Sks lookup pubkey - trailing slash`);
(async () => {
const email = '[email protected]';
const sks = new Sks('https://localhost:8001/');
const sks = new Sks(`https://localhost:${MOCK_PORT}/`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for unit tests we should leave fixed :8001, as different ports are used only in ui tests, so we can run multiple ui tests on different localhost ports

const { pubkey } = await sks.lookupEmail(email);
const key = await KeyUtil.parse(pubkey);
if (key.id !== '094C3CBA696FA009F6015C473B635D858A1DB5E0') {
Expand All @@ -35,7 +35,7 @@ BROWSER_UNIT_TEST_NAME(`Sks lookup pubkey - trailing slash`);
BROWSER_UNIT_TEST_NAME(`Sks lookup pubkey - no trailing slash`);
(async () => {
const email = '[email protected]';
const sks = new Sks('https://localhost:8001');
const sks = new Sks(`https://localhost:${MOCK_PORT}`);
const { pubkey } = await sks.lookupEmail(email);
const key = await KeyUtil.parse(pubkey);
if (key.id !== '094C3CBA696FA009F6015C473B635D858A1DB5E0') {
Expand All @@ -62,7 +62,7 @@ BROWSER_UNIT_TEST_NAME(`Sks lookup pubkey - server down`);
BROWSER_UNIT_TEST_NAME(`Sks lookup pubkey - not found`);
(async () => {
const email = '[email protected]';
const sks = new Sks('https://localhost:8001/');
const sks = new Sks(`https://localhost:${MOCK_PORT}/`);
const { pubkey } = await sks.lookupEmail(email);
if (pubkey !== null) {
throw Error(`expected pubkey=null but got ${pubkey}`);
Expand Down
8 changes: 4 additions & 4 deletions test/source/tests/compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3062,7 +3062,7 @@ export const defineComposeTests = (testVariant: TestVariant, testWithBrowser: Te
);

test(
'[email protected]:8001 - PWD encrypted message with FES web portal',
'[email protected]:{port} - PWD encrypted message with FES web portal',
testWithBrowser(async (t, browser) => {
const port = t.context.urls?.port;
t.context.mockApi!.configProvider = new ConfigurationProvider({
Expand Down Expand Up @@ -3122,7 +3122,7 @@ export const defineComposeTests = (testVariant: TestVariant, testWithBrowser: Te
);

test(
'[email protected]:8001 - PWD encrypted message with FES - Reply rendering',
'[email protected]:{port} - PWD encrypted message with FES - Reply rendering',
testWithBrowser(async (t, browser) => {
t.context.mockApi!.configProvider = new ConfigurationProvider({
attester: {
Expand Down Expand Up @@ -3218,7 +3218,7 @@ export const defineComposeTests = (testVariant: TestVariant, testWithBrowser: Te
);

test(
'[email protected]:8001 - PWD encrypted message with FES web portal - pubkey recipient in bcc',
'[email protected]:{port} - PWD encrypted message with FES web portal - pubkey recipient in bcc',
testWithBrowser(async (t, browser) => {
t.context.mockApi!.configProvider = new ConfigurationProvider({
attester: {
Expand Down Expand Up @@ -3255,7 +3255,7 @@ export const defineComposeTests = (testVariant: TestVariant, testWithBrowser: Te
);

test(
'[email protected]:8001 - PWD encrypted message with FES web portal - a send fails with gateway update error',
'[email protected]:{port} - PWD encrypted message with FES web portal - a send fails with gateway update error',
testWithBrowser(async (t, browser) => {
t.context.mockApi!.configProvider = new ConfigurationProvider({
attester: {
Expand Down
2 changes: 1 addition & 1 deletion test/source/tests/flaky.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export const defineFlakyTests = (testVariant: TestVariant, testWithBrowser: Test
);

test(
'[email protected]:8001 - PWD encrypted message with FES web portal - some sends fail with BadRequest error',
'[email protected]:{port} - PWD encrypted message with FES web portal - some sends fail with BadRequest error',
testWithBrowser(
async (t, browser) => {
t.context.mockApi!.configProvider = new ConfigurationProvider({
Expand Down
2 changes: 1 addition & 1 deletion test/source/tests/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2269,7 +2269,7 @@ AN8G3r5Htj8olot+jm9mIa5XLXWzMNUZgg==
);

test(
'[email protected]:8001 - uses FES on standard domain',
'[email protected]:{port} - uses FES on standard domain',
testWithBrowser(async (t, browser) => {
t.context.mockApi!.configProvider = new ConfigurationProvider({
attester: {
Expand Down
3 changes: 1 addition & 2 deletions test/source/tests/unit-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,10 @@ export const defineUnitBrowserTests = (testVariant: TestVariant, testWithBrowser
(window as any).testConstants = object;
}, testConstants);
// prepare code to run
const testCodeWithMockPort = testCode.replace(/\:8001/g, ':' + t.context.urls?.port);
const runThisCodeInBrowser = `
(async () => {
try {
return await ${testCodeWithMockPort}
return await ${testCode}
} catch (e) {
return "unit test threw something:" + String(e) + "\\n\\n" + e.stack;
}
Expand Down
19 changes: 10 additions & 9 deletions tooling/build-types-and-manifests.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* ©️ 2016 - present FlowCrypt a.s. Limitations apply. Contact [email protected] */
import { readFileSync, writeFileSync } from 'fs';
import { execSync as exec } from 'child_process';
const MOCK_PORT = '[TEST_REPLACEABLE_MOCK_PORT]';
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't import the MOCK_PORT variable here as we do in other places (e.g., import { MOCK_PORT } from './const.js';) because this is a separate TypeScript project.

To address this, I inserted [TEST_REPLACEABLE_MOCK_PORT] and replaced it later in config-mock-build.sh.

However, I feel that the current implementation has made the code a bit more complex. Let me know if this aligns with your expectations or if you have any other suggestions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, using separate MOCK_PORT variable adds some complexity, but it also removes a bit of confusion from generated original mock code where added :8001 should be replaced later again.
Your implementation looks good, let's continue with this approach.
Thanks for asking!


/**
* This file was originally two files: one that edited manifests, and one that copied build folders and edited mock versions
Expand Down Expand Up @@ -114,8 +115,8 @@ addManifest('chrome-enterprise', manifest => {
const CHROME_CONSUMER = 'chrome-consumer';
const CHROME_ENTERPRISE = 'chrome-enterprise';
const MOCK_HOST: { [buildType: string]: string } = {
'chrome-consumer': 'https://localhost:8001',
'chrome-enterprise': 'https://google.mock.localhost:8001',
'chrome-consumer': `https://localhost:${MOCK_PORT}`,
'chrome-enterprise': `https://google.mock.localhost:${MOCK_PORT}`,
};

const buildDir = (buildType: string) => `./build/${buildType}`;
Expand Down Expand Up @@ -153,7 +154,7 @@ const updateEnterpriseBuild = () => {

const makeMockBuild = (sourceBuildType: string) => {
const mockBuildType = `${sourceBuildType}-mock`;
const mockGmailPageHost = 'gmail.localhost:8001';
const mockGmailPageHost = `gmail.localhost:${MOCK_PORT}`;
const mockGmailPage = `https://${mockGmailPageHost}`;
exec(`cp -r ${buildDir(sourceBuildType)} ${buildDir(mockBuildType)}`);
const editor = (code: string) => {
Expand All @@ -162,19 +163,19 @@ const makeMockBuild = (sourceBuildType: string) => {
/const (OAUTH_GOOGLE_API_HOST|GMAIL_GOOGLE_API_HOST|PEOPLE_GOOGLE_API_HOST|GOOGLE_OAUTH_SCREEN_HOST) = [^;]+;/g,
`const $1 = '${MOCK_HOST[sourceBuildType]}';`
)
.replace(/const (BACKEND_API_HOST) = [^;]+;/g, `const $1 = 'https://localhost:8001/api/';`)
.replace(/const (ATTESTER_API_HOST) = [^;]+;/g, `const $1 = 'https://localhost:8001/attester/';`)
.replace(/const (KEYS_OPENPGP_ORG_API_HOST) = [^;]+;/g, `const $1 = 'https://localhost:8001/keys-openpgp-org/';`)
.replace(/const (SHARED_TENANT_API_HOST) = [^;]+;/g, `const $1 = 'https://localhost:8001/shared-tenant-fes';`)
.replace(/const (WKD_API_HOST) = '';/g, `const $1 = 'https://localhost:8001';`);
.replace(/const (BACKEND_API_HOST) = [^;]+;/g, `const $1 = 'https://localhost:${MOCK_PORT}/api/';`)
.replace(/const (ATTESTER_API_HOST) = [^;]+;/g, `const $1 = 'https://localhost:${MOCK_PORT}/attester/';`)
.replace(/const (KEYS_OPENPGP_ORG_API_HOST) = [^;]+;/g, `const $1 = 'https://localhost:${MOCK_PORT}/keys-openpgp-org/';`)
.replace(/const (SHARED_TENANT_API_HOST) = [^;]+;/g, `const $1 = 'https://localhost:${MOCK_PORT}/shared-tenant-fes';`)
.replace(/const (WKD_API_HOST) = '';/g, `const $1 = 'https://localhost:${MOCK_PORT}';`);
};
edit(`${buildDir(mockBuildType)}/js/common/core/const.js`, editor);
edit(`${buildDir(mockBuildType)}/js/common/platform/catch.js`, editor);
edit(`${buildDir(mockBuildType)}/js/content_scripts/webmail_bundle.js`, editor);
edit(`${buildDir(mockBuildType)}/manifest.json`, code =>
code
.replace(/https:\/\/mail\.google\.com/g, mockGmailPage)
.replace(/https:\/\/www\.google\.com/g, 'https://google.localhost:8001')
.replace(/https:\/\/www\.google\.com/g, `https://google.localhost:${MOCK_PORT}`)
.replace(/https:\/\/\*\.google.com\/\*/, 'https://google.localhost/*')
);
};
Expand Down
Loading