diff --git a/README.md b/README.md index daedaae..e94132f 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,8 @@ You can also run: This allows you to select a suite of URLs (in this case, "basic"), and open them in Chromium. This is useful for manually testing a set of URLs. +If, when running locally, you are seeing errors about certificates not being valid, set NODE_ENV to be 'development' e.g. `NODE_ENV=development;n-test smoke -H http://localhost:8080`. This will use some launch options that ignore certificate errors. + ### Expectations Checking response statii is great for checking that your application responds with _something_, but not necessarily the right thing. n-test comes with a bunch of basic things that you check for. diff --git a/lib/smoke/smoke-test.js b/lib/smoke/smoke-test.js index eea2b47..71d361d 100644 --- a/lib/smoke/smoke-test.js +++ b/lib/smoke/smoke-test.js @@ -66,7 +66,8 @@ class SmokeTest { const crossBrowserTests = []; // https://github.com/GoogleChrome/puppeteer/issues/2377 - this.browser = await puppeteer.launch({args: ['--ignore-certificate-errors', '--enable-features=NetworkService']}); + const launchOptions = (process.NODE_ENV === 'development') ? {args: ['--ignore-certificate-errors', '--enable-features=NetworkService']} : {}; + this.browser = await puppeteer.launch(launchOptions); for (let suiteOptions of configsToRun) { for (let path in suiteOptions.urls) { //eslint-disable-line guard-for-in