Skip to content

Commit

Permalink
test(launcher): add a test for invalid executablePath option
Browse files Browse the repository at this point in the history
This patch adds a test for invalid executablePath launcher option.
  • Loading branch information
austinkelleher authored and aslushnikov committed Oct 10, 2017
1 parent 13f100b commit 77d3c29
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/test.js
Expand Up @@ -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);
Expand Down

0 comments on commit 77d3c29

Please sign in to comment.