diff --git a/.travis.yml b/.travis.yml index 8f2f724..a5d3b4e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,7 @@ jobs: node_js: - "8" - "10" + - "12" script: - yarn test - stage: release diff --git a/lib/getManifest.js b/lib/getManifest.js index adfbbf7..4d72cfb 100644 --- a/lib/getManifest.js +++ b/lib/getManifest.js @@ -17,7 +17,7 @@ function getManifest(path) { let stat; try { stat = lstatSync(path); - } catch { + } catch (_) { // istanbul ignore next (hard to test — happens if no read acccess etc). throw new ReferenceError(`package.json cannot be read: "${path}"`); } @@ -29,7 +29,7 @@ function getManifest(path) { let contents; try { contents = readFileSync(path, "utf8"); - } catch { + } catch (_) { // istanbul ignore next (hard to test — happens if no read access etc). throw new ReferenceError(`package.json cannot be read: "${path}"`); } @@ -38,7 +38,7 @@ function getManifest(path) { let manifest; try { manifest = JSON.parse(contents); - } catch { + } catch (_) { throw new SyntaxError(`package.json could not be parsed: "${path}"`); }