Skip to content

Commit

Permalink
fix: correctly parse the default buildId (#10535)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed Jul 11, 2023
1 parent 19111be commit c308266
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/browsers/src/CLI.ts
Expand Up @@ -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';
}
}

Expand Down
10 changes: 10 additions & 0 deletions packages/browsers/test/src/firefox/cli.spec.ts
Expand Up @@ -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()}`,
]);
});
});

0 comments on commit c308266

Please sign in to comment.