Skip to content

Commit

Permalink
fix: do not use fallback download URLs if custom baseUrl is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed Apr 4, 2024
1 parent 4ec0280 commit 9130ab6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/browsers/src/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ export interface InstallOptions {
* @defaultValue `true`
*/
unpack?: boolean;
/**
* @internal
* @defaultValue `false`
*/
forceFallbackForTesting?: boolean;
}

/**
Expand Down Expand Up @@ -125,6 +130,10 @@ export async function install(
try {
return await installUrl(url, options);
} catch (err) {
// If custom baseUrl is provided, do not fall back to CfT dashboard.
if (options.baseUrl && !options.forceFallbackForTesting) {
throw err;
}
debugInstall(`Error downloading from ${url}.`);
switch (options.browser) {
case Browser.CHROME:
Expand Down
1 change: 1 addition & 0 deletions packages/browsers/test/src/chrome/install.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ describe('Chrome install', () => {
platform: BrowserPlatform.LINUX,
buildId: testChromeBuildId,
baseUrl: 'https://127.0.0.1',
forceFallbackForTesting: true,
});
assert.strictEqual(fs.existsSync(expectedOutputPath), true);
});
Expand Down

0 comments on commit 9130ab6

Please sign in to comment.