fix: correctly parse the default buildId (#10535)

This commit is contained in:
Alex Rudenko 2023-07-11 09:38:17 +02:00 committed by GitHub
parent 19111be8d0
commit c308266111
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -274,7 +274,8 @@ export class CLI {
}
#parseBuildId(version: string): string {
return version.split('@').pop() ?? 'latest';
const parts = version.split('@');
return parts.length === 2 ? parts[1]! : 'latest';
}
}

View File

@ -75,5 +75,15 @@ describe('Firefox CLI', function () {
'--platform=linux',
`--base-url=${getServerUrl()}`,
]);
await new CLI(tmpDir).run([
'npx',
'@puppeteer/browsers',
'install',
`firefox`,
`--path=${tmpDir}`,
'--platform=linux',
`--base-url=${getServerUrl()}`,
]);
});
});