mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: set revision based on PUPPETEER_PRODUCT (#5643)
This commit is contained in:
committed by
GitHub
parent
d817ae5a4b
commit
35989a78ba
@@ -59,14 +59,18 @@ const defaultBrowserOptions = {
|
||||
dumpio: !!process.env.DUMPIO,
|
||||
};
|
||||
|
||||
(async() => {
|
||||
if (defaultBrowserOptions.executablePath) {
|
||||
console.warn(`WARN: running ${product} tests with ${defaultBrowserOptions.executablePath}`);
|
||||
} else {
|
||||
if (product === 'firefox')
|
||||
await puppeteer._launcher._updateRevision();
|
||||
const executablePath = puppeteer.executablePath();
|
||||
if (!fs.existsSync(executablePath))
|
||||
throw new Error(`Browser is not downloaded at ${executablePath}. Run 'npm install' and try to re-run tests`);
|
||||
}
|
||||
})();
|
||||
|
||||
if (defaultBrowserOptions.executablePath) {
|
||||
console.warn(`WARN: running ${product} tests with ${defaultBrowserOptions.executablePath}`);
|
||||
} else {
|
||||
const executablePath = puppeteer.executablePath();
|
||||
if (!fs.existsSync(executablePath))
|
||||
throw new Error(`Browser is not downloaded at ${executablePath}. Run 'npm install' and try to re-run tests`);
|
||||
}
|
||||
|
||||
const setupGoldenAssertions = () => {
|
||||
const suffix = product.toLowerCase();
|
||||
|
||||
Reference in New Issue
Block a user