Warn when given unsupported product name. (#5845)

* Warn when given unsupported product name.

Fixes #5844.

This change means when a user launches Puppeteer with a product name
that is not supported (which at the time of this commit means it's not
`firefox` or `chrome) we will warn them about it.

Decided on just a warning vs an error because the current behaviour is
that we fallback to launching Chrome and I don't think this warrants a
breaking change.
This commit is contained in:
Jack Franklin
2020-05-12 10:30:24 +01:00
committed by GitHub
parent 6099272612
commit b38bb4334f
4 changed files with 29 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ const { TestServer } = require('../utils/testserver/index');
const path = require('path');
const fs = require('fs');
const os = require('os');
const sinon = require('sinon');
const puppeteer = require('../');
const utils = require('./utils');
const { trackCoverage } = require('./coverage-utils');
@@ -169,3 +170,7 @@ after(async () => {
await state.httpsServer.stop();
state.httpsServer = null;
});
afterEach(() => {
sinon.restore();
});