test(launcher): add a test for invalid executablePath option
This patch adds a test for invalid executablePath launcher option.
This commit is contained in:
parent
13f100bd26
commit
77d3c2972f
@ -102,6 +102,12 @@ describe('Puppeteer', function() {
|
||||
await neverResolves;
|
||||
expect(error.message).toContain('Protocol error');
|
||||
}));
|
||||
it('should reject if executable path is invalid', SX(async function() {
|
||||
let waitError = null;
|
||||
const options = Object.assign({}, defaultBrowserOptions, {executablePath: 'random-invalid-path'});
|
||||
await puppeteer.launch(options).catch(e => waitError = e);
|
||||
expect(waitError.message.startsWith('Failed to launch chrome! spawn random-invalid-path ENOENT')).toBe(true);
|
||||
}));
|
||||
it('userDataDir option', SX(async function() {
|
||||
const userDataDir = fs.mkdtempSync(path.join(__dirname, 'test-user-data-dir'));
|
||||
const options = Object.assign({userDataDir}, defaultBrowserOptions);
|
||||
|
Loading…
Reference in New Issue
Block a user