test(launcher): add a test for invalid executablePath option

This patch adds a test for invalid executablePath launcher option.
This commit is contained in:
Austin Kelleher 2017-10-10 14:10:26 -04:00 committed by Andrey Lushnikov
parent 13f100bd26
commit 77d3c2972f

View File

@ -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);