From 77d3c2972fcf073833c95723e07ac7b9cf4e5e2d Mon Sep 17 00:00:00 2001 From: Austin Kelleher Date: Tue, 10 Oct 2017 14:10:26 -0400 Subject: [PATCH] test(launcher): add a test for invalid executablePath option This patch adds a test for invalid executablePath launcher option. --- test/test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test.js b/test/test.js index 289cdfb067a..895cfe38040 100644 --- a/test/test.js +++ b/test/test.js @@ -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);