From 22462dc017bbf0d82ad733716d1f2fdb12215772 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Mon, 11 Feb 2019 22:56:33 -0800 Subject: [PATCH 1/2] chore: update yargs version --- lib/parse-args.js | 15 ++++-- package-lock.json | 125 ++++++++++++++++++++++++++++++++++++---------- package.json | 2 +- 3 files changed, 109 insertions(+), 33 deletions(-) diff --git a/lib/parse-args.js b/lib/parse-args.js index ee4f1955..e4141543 100644 --- a/lib/parse-args.js +++ b/lib/parse-args.js @@ -32,23 +32,28 @@ function buildYargs (withCommands = false) { }) .option('branches', { default: 0, - description: 'what % of branches must be covered?' + description: 'what % of branches must be covered?', + type: 'number' }) .option('functions', { default: 0, - description: 'what % of functions must be covered?' + description: 'what % of functions must be covered?', + type: 'number', }) .option('lines', { default: 90, - description: 'what % of lines must be covered?' + description: 'what % of lines must be covered?', + type: 'number' }) .option('statements', { default: 0, - description: 'what % of statements must be covered?' + description: 'what % of statements must be covered?', + type: 'number' }) .option('per-file', { default: false, - description: 'check thresholds per file' + description: 'check thresholds per file', + type: 'boolean' }) .option('temp-directory', { default: './coverage/tmp', diff --git a/package-lock.json b/package-lock.json index faa741cc..2ca18ea5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -61,6 +61,7 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -1181,6 +1182,11 @@ "safer-buffer": "^2.1.0" } }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + }, "end-of-stream": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", @@ -1705,7 +1711,8 @@ "get-caller-file": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", - "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=" + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", + "dev": true }, "get-func-name": { "version": "2.0.0", @@ -2199,7 +2206,8 @@ "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "optional": true }, "is-builtin-module": { "version": "1.0.0", @@ -2504,6 +2512,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "optional": true, "requires": { "is-buffer": "^1.1.5" } @@ -2606,7 +2615,8 @@ "longest": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=" + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "optional": true }, "loose-envify": { "version": "1.4.0", @@ -3035,9 +3045,9 @@ "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" }, "p-is-promise": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", - "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz", + "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==" }, "p-limit": { "version": "2.0.0", @@ -3473,7 +3483,8 @@ "repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "optional": true }, "repeating": { "version": "2.0.1", @@ -3870,6 +3881,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" @@ -3878,17 +3890,20 @@ "ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, "requires": { "ansi-regex": "^3.0.0" } @@ -4293,7 +4308,8 @@ "y18n": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true }, "yallist": { "version": "2.1.2", @@ -4301,22 +4317,21 @@ "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" }, "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.1.0.tgz", + "integrity": "sha512-1UhJbXfzHiPqkfXNHYhiz79qM/kZqjTE8yGlEjZa85Q+3+OwcV6NRkV7XOV1W2Eom2bzILeUn55pQYffjVOLAg==", "requires": { "cliui": "^4.0.0", - "decamelize": "^1.2.0", "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", + "get-caller-file": "^2.0.1", + "os-locale": "^3.1.0", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^2.0.0", + "string-width": "^3.0.0", "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" + "y18n": "^4.0.0", + "yargs-parser": "^13.0.0" }, "dependencies": { "ansi-regex": { @@ -4337,6 +4352,17 @@ "string-width": "^2.1.1", "strip-ansi": "^4.0.0", "wrap-ansi": "^2.0.0" + }, + "dependencies": { + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + } } }, "cross-spawn": { @@ -4365,6 +4391,11 @@ "strip-eof": "^1.0.0" } }, + "get-caller-file": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.1.tgz", + "integrity": "sha512-SpOZHfz845AH0wJYVuZk2jWDqFmu7Xubsx+ldIpwzy5pDUpu7OJHK7QYNSA2NPlDSKQwM1GFaAkciOWjjW92Sg==" + }, "get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -4378,6 +4409,11 @@ "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==" }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, "lcid": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", @@ -4387,13 +4423,13 @@ } }, "mem": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.0.0.tgz", - "integrity": "sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.1.0.tgz", + "integrity": "sha512-I5u6Q1x7wxO0kdOpYBB28xueHADYps5uty/zg936CiG8NTe5sJL8EjrCuLneuDW3PlMdZBGDIn8BirEVdovZvg==", "requires": { "map-age-cleaner": "^0.1.1", "mimic-fn": "^1.0.0", - "p-is-promise": "^1.1.0" + "p-is-promise": "^2.0.0" } }, "os-locale": { @@ -4406,11 +4442,41 @@ "mem": "^4.0.0" } }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, "semver": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" }, + "string-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.0.0.tgz", + "integrity": "sha512-rr8CUxBbvOZDUvc5lNIJ+OC1nPVpz+Siw9VBtUjB9b6jZehZLFt0JMCZzShFHIsI8cbhm0EsNIfWJMFV3cu3Ew==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", + "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==" + }, + "strip-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", + "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", + "requires": { + "ansi-regex": "^4.0.0" + } + } + } + }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -4419,10 +4485,15 @@ "ansi-regex": "^3.0.0" } }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" + }, "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", + "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" diff --git a/package.json b/package.json index db157d95..110056b2 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "test-exclude": "^5.0.0", "uuid": "^3.3.2", "v8-to-istanbul": "^2.0.2", - "yargs": "^12.0.5", + "yargs": "^13.1.0", "yargs-parser": "^10.1.0" }, "devDependencies": { From add91b37c1c082a8ce50c41b66585cebdc50fb50 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Mon, 11 Feb 2019 23:02:25 -0800 Subject: [PATCH 2/2] chore: update snapshot --- lib/parse-args.js | 2 +- test/integration.js.snap | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/parse-args.js b/lib/parse-args.js index e4141543..09d7ea47 100644 --- a/lib/parse-args.js +++ b/lib/parse-args.js @@ -38,7 +38,7 @@ function buildYargs (withCommands = false) { .option('functions', { default: 0, description: 'what % of functions must be covered?', - type: 'number', + type: 'number' }) .option('lines', { default: 90, diff --git a/test/integration.js.snap b/test/integration.js.snap index bfd7438d..55236f48 100644 --- a/test/integration.js.snap +++ b/test/integration.js.snap @@ -12,11 +12,11 @@ hey --------------------|----------|----------|----------|----------|-------------------| File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | --------------------|----------|----------|----------|----------|-------------------| -All files | 95.41 | 76.83 | 89.66 | 95.41 | | +All files | 95.46 | 76.83 | 89.66 | 95.46 | | bin | 85.71 | 83.33 | 100 | 85.71 | | c8.js | 85.71 | 83.33 | 100 | 85.71 | 25,32,33,34,35 | - lib | 97.05 | 65 | 100 | 97.05 | | - parse-args.js | 98.35 | 53.85 | 100 | 98.35 | 97,98 | + lib | 97.1 | 65 | 100 | 97.1 | | + parse-args.js | 98.41 | 53.85 | 100 | 98.41 | 102,103 | report.js | 96 | 70.37 | 100 | 96 |... 08,134,135,136 | lib/commands | 97.67 | 84.21 | 87.5 | 97.67 | | check-coverage.js | 100 | 92.86 | 100 | 100 | 17 | @@ -27,7 +27,7 @@ All files | 95.41 | 76.83 | 89.66 | 95.41 | normal.js | 76 | 75 | 33.33 | 76 | 14,15,16,18,19,20 | subprocess.js | 100 | 100 | 100 | 100 | | --------------------|----------|----------|----------|----------|-------------------| -,ERROR: Coverage for lines (95.41%) does not meet global threshold (101%) +,ERROR: Coverage for lines (95.46%) does not meet global threshold (101%) " `; @@ -40,7 +40,7 @@ ERROR: Coverage for lines (76%) does not meet threshold (80%) for test/fixtures/ exports[`c8 check-coverage exits with 0 if coverage within threshold 1`] = `",,"`; exports[`c8 check-coverage exits with 1 if coverage is below threshold 1`] = ` -",,ERROR: Coverage for lines (94.98%) does not meet global threshold (101%) +",,ERROR: Coverage for lines (95.03%) does not meet global threshold (101%) " `; @@ -52,11 +52,11 @@ second --------------------|----------|----------|----------|----------|-------------------| File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | --------------------|----------|----------|----------|----------|-------------------| -All files | 84.5 | 68.18 | 74.07 | 84.5 | | +All files | 84.67 | 68.18 | 74.07 | 84.67 | | bin | 85.71 | 66.67 | 100 | 85.71 | | c8.js | 85.71 | 66.67 | 100 | 85.71 | 25,32,33,34,35 | - lib | 95.57 | 55.56 | 100 | 95.57 | | - parse-args.js | 96.69 | 41.67 | 100 | 96.69 | 83,84,97,98 | + lib | 95.65 | 55.56 | 100 | 95.65 | | + parse-args.js | 96.83 | 41.67 | 100 | 96.83 | 88,89,102,103 | report.js | 94.67 | 62.5 | 100 | 94.67 |... 08,134,135,136 | lib/commands | 44.19 | 71.43 | 16.67 | 44.19 | | check-coverage.js | 23.33 | 100 | 0 | 23.33 |... 55,56,57,58,59 | @@ -74,11 +74,11 @@ exports[`c8 report generates report from existing temporary files 1`] = ` ",--------------------|----------|----------|----------|----------|-------------------| File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | --------------------|----------|----------|----------|----------|-------------------| -All files | 95.41 | 79.76 | 89.66 | 95.41 | | +All files | 95.46 | 79.76 | 89.66 | 95.46 | | bin | 85.71 | 85.71 | 100 | 85.71 | | c8.js | 85.71 | 85.71 | 100 | 85.71 | 25,32,33,34,35 | - lib | 97.05 | 69.05 | 100 | 97.05 | | - parse-args.js | 98.35 | 53.85 | 100 | 98.35 | 97,98 | + lib | 97.1 | 69.05 | 100 | 97.1 | | + parse-args.js | 98.41 | 53.85 | 100 | 98.41 | 102,103 | report.js | 96 | 75.86 | 100 | 96 |... 08,134,135,136 | lib/commands | 97.67 | 88.89 | 87.5 | 97.67 | | check-coverage.js | 100 | 92.31 | 100 | 100 | 17 | @@ -96,11 +96,11 @@ exports[`c8 report supports --check-coverage, when generating reports 1`] = ` ",--------------------|----------|----------|----------|----------|-------------------| File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | --------------------|----------|----------|----------|----------|-------------------| -All files | 95.85 | 79.76 | 93.1 | 95.85 | | +All files | 95.9 | 79.76 | 93.1 | 95.9 | | bin | 85.71 | 83.33 | 100 | 85.71 | | c8.js | 85.71 | 83.33 | 100 | 85.71 | 25,32,33,34,35 | - lib | 97.05 | 69.05 | 100 | 97.05 | | - parse-args.js | 98.35 | 53.85 | 100 | 98.35 | 97,98 | + lib | 97.1 | 69.05 | 100 | 97.1 | | + parse-args.js | 98.41 | 53.85 | 100 | 98.41 | 102,103 | report.js | 96 | 75.86 | 100 | 96 |... 08,134,135,136 | lib/commands | 100 | 89.47 | 100 | 100 | | check-coverage.js | 100 | 92.31 | 100 | 100 | 17 | @@ -111,7 +111,7 @@ All files | 95.85 | 79.76 | 93.1 | 95.85 | normal.js | 76 | 75 | 33.33 | 76 | 14,15,16,18,19,20 | subprocess.js | 100 | 100 | 100 | 100 | | --------------------|----------|----------|----------|----------|-------------------| -,ERROR: Coverage for lines (95.85%) does not meet global threshold (101%) +,ERROR: Coverage for lines (95.9%) does not meet global threshold (101%) " `;