Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix: install-deps did not throw on non 0 exit code (#12375)

Max Schmitt41e9b36f63f1
diff --git a/packages/playwright-core/src/utils/dependencies.ts b/packages/playwright-core/src/utils/dependencies.ts
index cb6bc509e1..51e692f84c 100644
--- a/packages/playwright-core/src/utils/dependencies.ts
+++ b/packages/playwright-core/src/utils/dependencies.ts
@@ -78,8 +78,8 @@ export async function installDependenciesLinux(targets: Set<DependencyGroup>, dr
if (elevatedPermissions)
console.log('Switching to root user to install dependencies...'); // eslint-disable-line no-console
const child = childProcess.spawn(command, args, { stdio: 'inherit' });
- await new Promise((resolve, reject) => {
- child.on('exit', resolve);
+ await new Promise<void>((resolve, reject) => {
+ child.on('exit', (code: number) => code === 0 ? resolve() : reject(new Error(`Installation process exited with code: ${code}`)));
child.on('error', reject);
});
}