From 64f2ee59305460fa1729499980485471a7f0e1b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Sun, 27 Nov 2016 13:34:07 +0100 Subject: [PATCH 01/27] Add coverage report --- .gitignore | 1 + .travis.yml | 6 ++++++ package.json | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 78f2710..c6f71ff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules/ +coverage/ .idea/ diff --git a/.travis.yml b/.travis.yml index 180e204..20b2dba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,3 +32,9 @@ before_install: # Update Node.js modules - "test ! -d node_modules || npm prune" - "test ! -d node_modules || npm rebuild" +addons: + code_climate: + repo_token: ca200a6930ee90adbc4192a3bdb9f60dccdae00cb78f9880a2841d6b + coverage/lcov.info +after_success: + - codeclimate-test-reporter < coverage/lcov.info diff --git a/package.json b/package.json index e6694df..6dc5de8 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,8 @@ "os-tmpdir": "~1.0.2" }, "devDependencies": { + "codeclimate-test-reporter": "^0.4.0", + "istanbul": "^0.4.5", "vows": "~0.7.0" }, "main": "lib/tmp.js", @@ -32,7 +34,7 @@ "lib/" ], "scripts": { - "test": "vows test/*-test.js", + "test": "istanbul cover vows test/*-test.js", "doc": "jsdoc -c .jsdoc.json" } } From e2c4ab4fd085ff07b3f50f37e4baa796cbba2c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Sun, 27 Nov 2016 13:34:52 +0100 Subject: [PATCH 02/27] Fix travis config --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 20b2dba..9f36672 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,6 +35,5 @@ before_install: addons: code_climate: repo_token: ca200a6930ee90adbc4192a3bdb9f60dccdae00cb78f9880a2841d6b - coverage/lcov.info after_success: - codeclimate-test-reporter < coverage/lcov.info From 663a13a4875a22ec0ce5ae93afbbed3414010192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Sun, 27 Nov 2016 13:36:34 +0100 Subject: [PATCH 03/27] Fix package.json --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6dc5de8..1062fd2 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,8 @@ "os-tmpdir": "~1.0.2" }, "devDependencies": { - "codeclimate-test-reporter": "^0.4.0", - "istanbul": "^0.4.5", + "codeclimate-test-reporter": "~0.4.0", + "istanbul": "~0.4.5", "vows": "~0.7.0" }, "main": "lib/tmp.js", From 2d26e0b45351c69af5b63baeb1b7f7d03057f61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Mon, 28 Nov 2016 19:53:13 +0100 Subject: [PATCH 04/27] Add ratings for the lib path --- .codeclimate.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.codeclimate.yml b/.codeclimate.yml index 321f96c..5e877f4 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -2,5 +2,8 @@ engines: eslint: enabled: true channel: "eslint-3" +ratings: + paths: + - "lib/**/*.js" exclude_paths: - "docs/" From a497aa94d175af97af18f0810e3e8d3ce4b11f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Fri, 1 Dec 2017 16:40:40 -0800 Subject: [PATCH 05/27] Add lint task --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index ddee70e..505dc51 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "lib/" ], "scripts": { + "lint": "eslint lib test", "test": "mocha test/*-test.js", "doc": "jsdoc -c .jsdoc.json" } From e944109acbed6423a480f307e761b7d51b4e9f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Fri, 1 Dec 2017 16:45:03 -0800 Subject: [PATCH 06/27] Add eslint as a dev dependency --- package-lock.json | 1035 ++++++++++++++++++++++++++++++++++++++++++++- package.json | 1 + 2 files changed, 1035 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 136640c..33602ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,9 +1,139 @@ { "name": "tmp", - "version": "0.0.33", + "version": "0.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { + "acorn": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.2.1.tgz", + "integrity": "sha512-jG0u7c4Ly+3QkkW18V+NRDN+4bWHdln30NL1ZL2AvFZZmQe/BfopYCtghCKKVBUSetZ4QKcyA0pY6/4Gw8Pv8w==", + "dev": true + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "3.3.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "ajv": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.0.tgz", + "integrity": "sha1-6yhAdG6dxIvV4GOjbj/UAMXqtak=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.0.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "dev": true + }, + "ansi-escapes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz", + "integrity": "sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ==", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "argparse": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + }, + "dependencies": { + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -26,6 +156,106 @@ "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", "dev": true }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "color-convert": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "commander": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", @@ -41,6 +271,34 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "concat-stream": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.3", + "typedarray": "0.0.6" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "4.1.1", + "shebang-command": "1.2.0", + "which": "1.3.0" + } + }, "debug": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.0.tgz", @@ -50,24 +308,253 @@ "ms": "0.7.2" } }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.0", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "2.6.2" + } + }, "diff": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", "dev": true }, + "doctrine": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.2.tgz", + "integrity": "sha512-y0tm5Pq6ywp3qSTZ1vPgVdAnbDEoeoc5wlOHXoY1c4Wug/a7JvqHIl7BTvwodaHmejWkK/9dSb3sCYfyo/om8A==", + "dev": true, + "requires": { + "esutils": "2.0.2" + } + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, + "eslint": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.12.1.tgz", + "integrity": "sha512-28hOYej+NZ/R5H1yMvyKa1+bPlu+fnsIAQffK6hxXgvmXnImos2bA5XfCn5dYv2k2mrKj+/U/Z4L5ICWxC7TQw==", + "dev": true, + "requires": { + "ajv": "5.5.0", + "babel-code-frame": "6.26.0", + "chalk": "2.3.0", + "concat-stream": "1.6.0", + "cross-spawn": "5.1.0", + "debug": "3.1.0", + "doctrine": "2.0.2", + "eslint-scope": "3.7.1", + "espree": "3.5.2", + "esquery": "1.0.0", + "estraverse": "4.2.0", + "esutils": "2.0.2", + "file-entry-cache": "2.0.0", + "functional-red-black-tree": "1.0.1", + "glob": "7.1.2", + "globals": "11.0.1", + "ignore": "3.3.7", + "imurmurhash": "0.1.4", + "inquirer": "3.3.0", + "is-resolvable": "1.0.0", + "js-yaml": "3.10.0", + "json-stable-stringify-without-jsonify": "1.0.1", + "levn": "0.3.0", + "lodash": "4.17.4", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "natural-compare": "1.4.0", + "optionator": "0.8.2", + "path-is-inside": "1.0.2", + "pluralize": "7.0.0", + "progress": "2.0.0", + "require-uncached": "1.0.3", + "semver": "5.4.1", + "strip-ansi": "4.0.0", + "strip-json-comments": "2.0.1", + "table": "4.0.2", + "text-table": "0.2.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "dev": true, + "requires": { + "esrecurse": "4.2.0", + "estraverse": "4.2.0" + } + }, + "espree": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.2.tgz", + "integrity": "sha512-sadKeYwaR/aJ3stC2CdvgXu1T16TdYN+qwCpcWbMnGJ8s0zNWemzrvb2GbD4OhmJ/fwpJjudThAlLobGbWZbCQ==", + "dev": true, + "requires": { + "acorn": "5.2.1", + "acorn-jsx": "3.0.1" + } + }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + }, + "esquery": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", + "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "esrecurse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz", + "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=", + "dev": true, + "requires": { + "estraverse": "4.2.0", + "object-assign": "4.1.1" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "external-editor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", + "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==", + "dev": true, + "requires": { + "chardet": "0.4.2", + "iconv-lite": "0.4.19", + "tmp": "0.0.33" + } + }, + "fast-deep-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", + "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "1.3.0", + "object-assign": "4.1.1" + } + }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "dev": true, + "requires": { + "circular-json": "0.3.3", + "del": "2.2.2", + "graceful-fs": "4.1.11", + "write": "0.2.1" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "glob": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", @@ -82,6 +569,32 @@ "path-is-absolute": "1.0.1" } }, + "globals": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.0.1.tgz", + "integrity": "sha1-Eqh7sBDlFUOWrMU14eQ/x1Ow5eg=", + "dev": true + }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.1", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, "graceful-readlink": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", @@ -94,12 +607,39 @@ "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", "dev": true }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, "has-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", "dev": true }, + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", + "dev": true + }, + "ignore": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", + "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -116,12 +656,135 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, + "inquirer": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "dev": true, + "requires": { + "ansi-escapes": "3.0.0", + "chalk": "2.3.0", + "cli-cursor": "2.1.0", + "cli-width": "2.2.0", + "external-editor": "2.1.0", + "figures": "2.0.0", + "lodash": "4.17.4", + "mute-stream": "0.0.7", + "run-async": "2.3.0", + "rx-lite": "4.0.8", + "rx-lite-aggregates": "4.0.8", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "through": "2.3.8" + } + }, + "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=", + "dev": true + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", + "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", + "dev": true, + "requires": { + "is-path-inside": "1.0.1" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "1.0.2" + } + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-resolvable": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz", + "integrity": "sha1-jfV8YeouPFAUCNEA+wE8+NbgzGI=", + "dev": true, + "requires": { + "tryit": "1.0.3" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", + "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "dev": true, + "requires": { + "argparse": "1.0.9", + "esprima": "4.0.0" + } + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json3": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", "dev": true }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "lodash": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", + "dev": true + }, "lodash._baseassign": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", @@ -190,6 +853,22 @@ "lodash.isarray": "3.0.4" } }, + "lru-cache": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", + "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "dev": true, + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "mimic-fn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz", + "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=", + "dev": true + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -239,6 +918,24 @@ "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", "dev": true }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -248,6 +945,29 @@ "wrappy": "1.0.2" } }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "1.1.0" + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + } + }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -259,6 +979,227 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "dev": true + }, + "progress": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", + "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "0.1.0", + "resolve-from": "1.0.1" + } + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "2.0.1", + "signal-exit": "3.0.2" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "7.1.1" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "2.1.0" + } + }, + "rx-lite": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", + "dev": true + }, + "rx-lite-aggregates": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", + "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "dev": true, + "requires": { + "rx-lite": "4.0.8" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "slice-ansi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "string-width": { + "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" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "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" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + } + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, "supports-color": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", @@ -268,11 +1209,103 @@ "has-flag": "1.0.0" } }, + "table": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "dev": true, + "requires": { + "ajv": "5.5.0", + "ajv-keywords": "2.1.1", + "chalk": "2.3.0", + "lodash": "4.17.4", + "slice-ansi": "1.0.0", + "string-width": "2.1.1" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "1.0.2" + } + }, + "tryit": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz", + "integrity": "sha1-OTvnMKlEb9Hq1tpZoBQwjzbCics=", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "0.5.1" + } + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true } } } diff --git a/package.json b/package.json index 505dc51..277d0d4 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "os-tmpdir": "~1.0.2" }, "devDependencies": { + "eslint": "^4.12.1", "mocha": "~3.4.2" }, "main": "lib/tmp.js", From 87d10be35135127e300a8f6a212a2ff194be4ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Fri, 1 Dec 2017 17:00:36 -0800 Subject: [PATCH 07/27] Add eslint-plugin-mocha --- .eslintrc.js | 3 +++ package-lock.json | 15 +++++++++++++++ package.json | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 02c4bd6..45d1d61 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -3,6 +3,9 @@ module.exports = { "es6": true, "node": true }, + "plugins": [ + "mocha" + ], "extends": "eslint:recommended", "rules": { "indent": [ diff --git a/package-lock.json b/package-lock.json index 33602ff..37ea1a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -426,6 +426,15 @@ } } }, + "eslint-plugin-mocha": { + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-4.11.0.tgz", + "integrity": "sha1-kRk6L1XiCl41l0BUoAidMBmO5Xg=", + "dev": true, + "requires": { + "ramda": "0.24.1" + } + }, "eslint-scope": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", @@ -1036,6 +1045,12 @@ "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, + "ramda": { + "version": "0.24.1", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.24.1.tgz", + "integrity": "sha1-w7d1UZfzW43DUCIoJixMkd22uFc=", + "dev": true + }, "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", diff --git a/package.json b/package.json index 277d0d4..0bc7fdd 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ }, "devDependencies": { "eslint": "^4.12.1", + "eslint-plugin-mocha": "^4.11.0", "mocha": "~3.4.2" }, "main": "lib/tmp.js", @@ -33,7 +34,7 @@ "lib/" ], "scripts": { - "lint": "eslint lib test", + "lint": "eslint lib --env mocha test", "test": "mocha test/*-test.js", "doc": "jsdoc -c .jsdoc.json" } From 8d3f29bd16baf02f8db9d957336c6990709495ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Fri, 1 Dec 2017 17:01:05 -0800 Subject: [PATCH 08/27] Remove unused variable --- lib/tmp.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/tmp.js b/lib/tmp.js index 1175a4f..c475806 100644 --- a/lib/tmp.js +++ b/lib/tmp.js @@ -521,10 +521,6 @@ function setGracefulCleanup() { _gracefulCleanup = true; } -const version = process.versions.node.split('.').map(function (value) { - return parseInt(value, 10); -}); - /** * If there are multiple different versions of tmp in place, make sure that * we recognize the old listeners. From 39014329880baa1983d0d63dd6a180bdfff86b92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Fri, 1 Dec 2017 17:01:39 -0800 Subject: [PATCH 09/27] Fix eslint issues in tests --- test/child-process.js | 2 +- test/inband-standard.js | 5 ++--- test/issue129-test.js | 4 ++-- test/name-inband-standard.js | 8 ++------ test/outband/graceful.js | 2 +- test/outband/issue115.js | 2 +- test/outband/issue129.js | 26 +++++++++++--------------- test/outband/issue62.js | 8 +++----- test/outband/keep.js | 2 +- test/outband/unlink.js | 2 +- test/outband/unsafe.js | 2 +- test/spawn.js | 4 ---- test/util.js | 2 +- 13 files changed, 27 insertions(+), 42 deletions(-) diff --git a/test/child-process.js b/test/child-process.js index 20c6c02..d652110 100644 --- a/test/child-process.js +++ b/test/child-process.js @@ -29,7 +29,7 @@ module.exports.childProcess = function spawnChildProcess(configFile, cb) { return cb(new Error('ENOENT: configFile ' + configFilePath + ' does not exist')); _do_spawn(command_args, cb); -} +}; function _do_spawn(command_args, cb) { var diff --git a/test/inband-standard.js b/test/inband-standard.js index 7a99b80..ef749af 100644 --- a/test/inband-standard.js +++ b/test/inband-standard.js @@ -33,7 +33,7 @@ function inbandStandardTests(testOpts, opts, isFile, beforeHook) { testOpts = testOpts || {}; // topic reference will be created by the beforeHook - topic = { topic: null, opts: opts }; + const topic = { topic: null, opts: opts }; // bind everything to topic so we avoid global before(beforeHook.bind(topic)); @@ -77,5 +77,4 @@ function inbandStandardTests(testOpts, opts, isFile, beforeHook) { assert.ok(!existsSync(this.topic.name)); }.bind(topic)); }; -}; - +} diff --git a/test/issue129-test.js b/test/issue129-test.js index 4380f0f..14a6679 100644 --- a/test/issue129-test.js +++ b/test/issue129-test.js @@ -9,7 +9,7 @@ var describe('tmp', function () { describe('issue129: safely install listeners', function () { it('when simulating sandboxed behavior', function (done) { - childProcess('issue129.json', function (err, stderr, stdout) { + childProcess('issue129.json', function (err, stderr) { if (err) return done(err); else if (stderr) { assertions.assertDoesNotStartWith(stderr, 'EEXISTS:LEGACY:EXIT'); @@ -20,9 +20,9 @@ describe('tmp', function () { assertions.assertDoesNotStartWith(stderr, 'ENOAVAIL:NEWSTYLE'); assert.equal(stderr, 'EOK', 'existing listeners should have been removed and called'); } + done(); }); }); }); }); - diff --git a/test/name-inband-standard.js b/test/name-inband-standard.js index 4445151..4d4cbb3 100644 --- a/test/name-inband-standard.js +++ b/test/name-inband-standard.js @@ -2,10 +2,7 @@ // vim: expandtab:ts=2:sw=2 var - assert = require('assert'), - fs = require('fs'), path = require('path'), - existsSync = fs.existsSync || path.existsSync, assertions = require('./assertions'), tmp = require('../lib/tmp'); @@ -24,7 +21,7 @@ function inbandStandardTests(testOpts, opts, beforeHook) { return function () { opts = opts || {}; testOpts = testOpts || {}; - topic = { topic: null, opts: opts }; + const topic = { topic: null, opts: opts }; // bind everything to topic so we avoid global before(beforeHook.bind(topic)); @@ -51,5 +48,4 @@ function inbandStandardTests(testOpts, opts, beforeHook) { }.bind(topic)); } }; -}; - +} diff --git a/test/outband/graceful.js b/test/outband/graceful.js index cd34818..f86bfd1 100644 --- a/test/outband/graceful.js +++ b/test/outband/graceful.js @@ -1,4 +1,4 @@ -module.exports = function (result, tmp) { +module.exports = function (result) { this.out(result.name, function () { throw new Error('(non-)graceful cleanup testing'); }); diff --git a/test/outband/issue115.js b/test/outband/issue115.js index f158d38..427f6ad 100644 --- a/test/outband/issue115.js +++ b/test/outband/issue115.js @@ -1,6 +1,6 @@ var fs = require('fs'); -module.exports = function (result, tmp) { +module.exports = function (result) { // creates a tmp file and then closes the file descriptor as per issue 115 // https://github.com/raszi/node-tmp/issues/115 fs.closeSync(result.fd); diff --git a/test/outband/issue129.js b/test/outband/issue129.js index 653e9a1..0d65547 100644 --- a/test/outband/issue129.js +++ b/test/outband/issue129.js @@ -1,18 +1,15 @@ /* eslint-disable no-octal */ // vim: expandtab:ts=2:sw=2 -var fs = require('fs'); - // https://github.com/raszi/node-tmp/issues/129 module.exports = function () { + // dup from lib/tmp.js + function _is_legacy_listener(listener) { + return (listener.name == '_exit' || listener.name == '_uncaughtExceptionThrown') + && listener.toString().indexOf('_garbageCollector();') != -1; + } -// dup from lib/tmp.js -function _is_legacy_listener(listener) { - return (listener.name == '_exit' || listener.name == '_uncaughtExceptionThrown') - && listener.toString().indexOf('_garbageCollector();') != -1; -} - -function _garbageCollector() {} + function _garbageCollector() {} var callState = { newStyleListener : false, @@ -22,7 +19,7 @@ function _garbageCollector() {} // simulate the new exit listener var listener1 = (function (callState) { - return function _tmp$safe_listener(data) { + return function _tmp$safe_listener() { _garbageCollector(); callState.newStyleListener = true; }; @@ -30,7 +27,7 @@ function _garbageCollector() {} // simulate the legacy _exit listener var listener2 = (function (callState) { - return function _exit(code) { + return function _exit() { _garbageCollector(); callState.legacyExitListener = true; }; @@ -38,18 +35,18 @@ function _garbageCollector() {} // simulate the legacy _uncaughtExceptionThrown listener var listener3 = (function (callState) { - return function _uncaughtExceptionThrown(err) { + return function _uncaughtExceptionThrown() { _garbageCollector(); callState.legacyUncaughtListener = true; }; })(callState); - process.addListener('exit', listener1); + process.addListener('exit', listener1); process.addListener('exit', listener2); process.addListener('exit', listener3); // now let tmp install its listener safely - var tmp = require('../../lib/tmp'); + require('../../lib/tmp'); var legacyExitListener = null; var legacyUncaughtListener = null; @@ -77,4 +74,3 @@ function _garbageCollector() {} if (!callState.newStyleListener) this.fail('ENOAVAIL:NEWSTYLE: existing new style listener was not called', this.exit); this.out('EOK', this.exit); }; - diff --git a/test/outband/issue62.js b/test/outband/issue62.js index 54fb944..3dffd60 100644 --- a/test/outband/issue62.js +++ b/test/outband/issue62.js @@ -1,8 +1,7 @@ -var - fs = require('fs'), - join = require('path').join; +var fs = require('fs'); +var join = require('path').join; -module.exports = function (result, tmp) { +module.exports = function (result) { // creates structure from issue 62 // https://github.com/raszi/node-tmp/issues/62 @@ -15,4 +14,3 @@ module.exports = function (result, tmp) { this.out(result.name, this.exit); }; - diff --git a/test/outband/keep.js b/test/outband/keep.js index 861458f..75dccea 100644 --- a/test/outband/keep.js +++ b/test/outband/keep.js @@ -1,3 +1,3 @@ -module.exports = function (result, tmp) { +module.exports = function (result) { this.out(result.name); }; diff --git a/test/outband/unlink.js b/test/outband/unlink.js index bda80d1..83efe58 100644 --- a/test/outband/unlink.js +++ b/test/outband/unlink.js @@ -1,6 +1,6 @@ const fs = require('fs'); -module.exports = function (result, tmp) { +module.exports = function (result) { const stat = fs.statSync(result.name); if (stat.isFile()) { fs.unlinkSync(result.name); diff --git a/test/outband/unsafe.js b/test/outband/unsafe.js index f37c4df..a4ed7e0 100644 --- a/test/outband/unsafe.js +++ b/test/outband/unsafe.js @@ -2,7 +2,7 @@ var fs = require('fs'), join = require('path').join; -module.exports = function (result, tmp) { +module.exports = function (result) { // file that should be removed var fd = fs.openSync(join(result.name, 'should-be-removed.file'), 'w'); fs.closeSync(fd); diff --git a/test/spawn.js b/test/spawn.js index 9635e94..5dfd87e 100644 --- a/test/spawn.js +++ b/test/spawn.js @@ -1,9 +1,5 @@ // vim: expandtab:ts=2:sw=2 -var - fs = require('fs'), - path = require('path'); - function _writeSync(stream, str, cb) { var flushed = stream.write(str); if (flushed) { diff --git a/test/util.js b/test/util.js index 0d399df..478148c 100644 --- a/test/util.js +++ b/test/util.js @@ -6,4 +6,4 @@ var module.exports.readJsonConfig = function readJsonConfig(path) { var contents = fs.readFileSync(path); return JSON.parse(contents); -} +}; From 30f970d873523ca1679a5a307f1dad537dc13168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Fri, 1 Dec 2017 17:03:31 -0800 Subject: [PATCH 10/27] Make sure that linter runs before the tests --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0bc7fdd..dc01748 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ ], "scripts": { "lint": "eslint lib --env mocha test", - "test": "mocha test/*-test.js", + "test": "npm run lint && mocha test/*-test.js", "doc": "jsdoc -c .jsdoc.json" } } From 1850f13db9b4f359c8a8471a050ce9f842169722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Fri, 1 Dec 2017 17:21:20 -0800 Subject: [PATCH 11/27] Update package-lock.json --- package-lock.json | 993 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 992 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 136640c..8432e64 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,117 @@ { "name": "tmp", - "version": "0.0.33", + "version": "0.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { + "abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "argparse": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", + "dev": true + }, + "assert-plus": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", + "dev": true + }, + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "aws-sign2": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", + "dev": true + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", + "dev": true + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "bl": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.1.2.tgz", + "integrity": "sha1-/cqHGplxOqANGeO7ukHER4emU5g=", + "dev": true, + "requires": { + "readable-stream": "2.0.6" + } + }, + "boom": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, "brace-expansion": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", @@ -26,6 +128,93 @@ "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", "dev": true }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, + "optional": true + }, + "caseless": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", + "dev": true + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "optional": true, + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + } + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + }, + "dependencies": { + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "optional": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true, + "optional": true + } + } + }, + "codeclimate-test-reporter": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/codeclimate-test-reporter/-/codeclimate-test-reporter-0.4.1.tgz", + "integrity": "sha1-nyD22C02qrmdIKvk9sc3L0xtGRU=", + "dev": true, + "requires": { + "async": "1.5.2", + "commander": "2.9.0", + "lcov-parse": "0.0.10", + "request": "2.74.0" + } + }, + "combined-stream": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", + "dev": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, "commander": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", @@ -41,6 +230,38 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "dev": true, + "requires": { + "boom": "2.10.1" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, "debug": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.0.tgz", @@ -50,24 +271,162 @@ "ms": "0.7.2" } }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true, + "optional": true + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, "diff": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", "dev": true }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, + "escodegen": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "dev": true, + "requires": { + "esprima": "2.7.3", + "estraverse": "1.9.3", + "esutils": "2.0.2", + "optionator": "0.8.2", + "source-map": "0.2.0" + } + }, + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "dev": true + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.1.tgz", + "integrity": "sha1-rjFduaSQf6BlUCMEpm13M0de43w=", + "dev": true, + "requires": { + "async": "2.6.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.17" + }, + "dependencies": { + "async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "dev": true, + "requires": { + "lodash": "4.17.4" + } + } + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "generate-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", + "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", + "dev": true + }, + "generate-object-property": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", + "dev": true, + "requires": { + "is-property": "1.0.2" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, "glob": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", @@ -94,12 +453,85 @@ "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", "dev": true }, + "handlebars": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", + "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "dev": true, + "requires": { + "async": "1.5.2", + "optimist": "0.6.1", + "source-map": "0.4.4", + "uglify-js": "2.8.29" + }, + "dependencies": { + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "har-validator": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", + "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "commander": "2.9.0", + "is-my-json-valid": "2.16.1", + "pinkie-promise": "2.0.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, "has-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", "dev": true }, + "hawk": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "dev": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "dev": true + }, + "http-signature": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "dev": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.1", + "sshpk": "1.13.1" + } + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -116,12 +548,198 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-my-json-valid": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.1.tgz", + "integrity": "sha512-ochPsqWS1WXj8ZnMIV0vnNXooaMhp7cyL4FMSIPKTtnV0Ha/T19G2b9kkhcNsabV9bxYkze7/aLZJb/bYuFduQ==", + "dev": true, + "requires": { + "generate-function": "2.0.0", + "generate-object-property": "1.2.0", + "jsonpointer": "4.0.1", + "xtend": "4.0.1" + } + }, + "is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "istanbul": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", + "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", + "dev": true, + "requires": { + "abbrev": "1.0.9", + "async": "1.5.2", + "escodegen": "1.8.1", + "esprima": "2.7.3", + "glob": "5.0.15", + "handlebars": "4.0.11", + "js-yaml": "3.10.0", + "mkdirp": "0.5.1", + "nopt": "3.0.6", + "once": "1.4.0", + "resolve": "1.1.7", + "supports-color": "3.1.2", + "which": "1.3.0", + "wordwrap": "1.0.0" + }, + "dependencies": { + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + } + } + }, + "js-yaml": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", + "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "dev": true, + "requires": { + "argparse": "1.0.9", + "esprima": "4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + } + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, "json3": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", "dev": true }, + "jsonpointer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", + "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", + "dev": true + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true, + "optional": true + }, + "lcov-parse": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", + "integrity": "sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "lodash": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", + "dev": true + }, "lodash._baseassign": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", @@ -190,6 +808,27 @@ "lodash.isarray": "3.0.4" } }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "mime-db": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", + "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=", + "dev": true + }, + "mime-types": { + "version": "2.1.17", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", + "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", + "dev": true, + "requires": { + "mime-db": "1.30.0" + } + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -239,6 +878,27 @@ "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", "dev": true }, + "node-uuid": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz", + "integrity": "sha1-sEDrCSOWivq/jTL7HxfxFn/auQc=", + "dev": true + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1.0.9" + } + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "dev": true + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -248,6 +908,38 @@ "wrappy": "1.0.2" } }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "0.0.8", + "wordwrap": "0.0.3" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + } + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + } + }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -259,6 +951,180 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "dev": true + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "qs": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.2.3.tgz", + "integrity": "sha1-HPyyXBCpsrSDBT/zn138kjOQjP4=", + "dev": true + }, + "readable-stream": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "0.10.31", + "util-deprecate": "1.0.2" + } + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "request": { + "version": "2.74.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.74.0.tgz", + "integrity": "sha1-dpPKdou7DqXIzgjAhKRe+gW4kqs=", + "dev": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "bl": "1.1.2", + "caseless": "0.11.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "1.0.1", + "har-validator": "2.0.6", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.17", + "node-uuid": "1.4.8", + "oauth-sign": "0.8.2", + "qs": "6.2.3", + "stringstream": "0.0.5", + "tough-cookie": "2.3.3", + "tunnel-agent": "0.4.3" + } + }, + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "optional": true, + "requires": { + "align-text": "0.1.4" + } + }, + "sntp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "dev": true, + "optional": true, + "requires": { + "amdefine": "1.0.1" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", + "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", + "dev": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, "supports-color": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", @@ -268,11 +1134,136 @@ "has-flag": "1.0.0" } }, + "tough-cookie": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", + "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", + "dev": true, + "requires": { + "punycode": "1.4.1" + } + }, + "tunnel-agent": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", + "dev": true + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true, + "optional": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2" + } + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "optional": true, + "requires": { + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "optional": true + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true, + "optional": true + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "optional": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } } } } From 9c4157273a61a6bb038983a897ef96c74d291005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Fri, 1 Dec 2017 17:21:26 -0800 Subject: [PATCH 12/27] Make it work with mocha --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eabbc2c..d249d3b 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ ], "scripts": { "lint": "eslint lib test", - "test": "istanbul cover mocha test/*-test.js", + "test": "istanbul cover _mocha -u exports -R test/*-test.js", "doc": "jsdoc -c .jsdoc.json" } } From ab47bdcf1c462555dd7844c0f4883913a12c0892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Fri, 1 Dec 2017 17:23:04 -0800 Subject: [PATCH 13/27] Remove unrelated change --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index d249d3b..eaa7028 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,6 @@ "lib/" ], "scripts": { - "lint": "eslint lib test", "test": "istanbul cover _mocha -u exports -R test/*-test.js", "doc": "jsdoc -c .jsdoc.json" } From 2613f133d36ca9ce107ca0cab93d387b4cb0ba54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Fri, 1 Dec 2017 22:10:58 -0800 Subject: [PATCH 14/27] Remove linting on test run --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dc01748..0bc7fdd 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ ], "scripts": { "lint": "eslint lib --env mocha test", - "test": "npm run lint && mocha test/*-test.js", + "test": "mocha test/*-test.js", "doc": "jsdoc -c .jsdoc.json" } } From 9a9598f0a419ae80bdbc1cd50e7506d5c45e25bd Mon Sep 17 00:00:00 2001 From: Carsten Klein Date: Thu, 7 Dec 2017 20:51:01 +0100 Subject: [PATCH 15/27] collect coverage from child processes --- .istanbul.yml | 6 ++++++ package.json | 3 ++- test/child-process.js | 13 ++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 .istanbul.yml diff --git a/.istanbul.yml b/.istanbul.yml new file mode 100644 index 0000000..5ea2bdd --- /dev/null +++ b/.istanbul.yml @@ -0,0 +1,6 @@ +check: + global: + statements: 100 + lines: 100 + branches: 100 + functions: 100 diff --git a/package.json b/package.json index eaa7028..9a67196 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,8 @@ "lib/" ], "scripts": { - "test": "istanbul cover _mocha -u exports -R test/*-test.js", + "clean": "rm -Rf ./coverage", + "test": "istanbul cover _mocha --report none --print none --dir ./coverage/json -u exports -R test/*-test.js && istanbul report --root ./coverage/json html && istanbul check-coverage || true", "doc": "jsdoc -c .jsdoc.json" } } diff --git a/test/child-process.js b/test/child-process.js index 20c6c02..511d64e 100644 --- a/test/child-process.js +++ b/test/child-process.js @@ -41,9 +41,20 @@ function _do_spawn(command_args, cb) { stderrDone = false, stdoutDone = false; + if (process.env.running_under_istanbul) { + var + istanbul_path = path.join(__dirname, '..', 'node_modules', '.bin', 'istanbul'), + istanbul_args = [ + 'cover', '--report' , 'none', '--print', 'none', '--dir', path.join('coverage', 'json'), + '--include-pid', command_args[0], '--', command_args[1] + ]; + child = spawn(istanbul_path, istanbul_args); + } + else { + child = spawn(node_path, command_args); + } // spawn doesn’t have the quoting problems that exec does, // especially when going for Windows portability. - child = spawn(node_path, command_args); child.stdin.end(); // TODO:we no longer support node 0.6 // Cannot use 'close' event because not on node-0.6. From d188536b1538f7195d5bc9806bcb4de7e913deb1 Mon Sep 17 00:00:00 2001 From: Carsten Klein Date: Thu, 7 Dec 2017 22:58:13 +0100 Subject: [PATCH 16/27] fix tests failing on appveyor --- package.json | 2 +- test/child-process.js | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 9a67196..31bb3aa 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ ], "scripts": { "clean": "rm -Rf ./coverage", - "test": "istanbul cover _mocha --report none --print none --dir ./coverage/json -u exports -R test/*-test.js && istanbul report --root ./coverage/json html && istanbul check-coverage || true", + "test": "istanbul cover ./node_modules/mocha/bin/_mocha --report none --print none --dir ./coverage/json -u exports -R test/*-test.js && istanbul report --root ./coverage/json html && istanbul report text-summary", "doc": "jsdoc -c .jsdoc.json" } } diff --git a/test/child-process.js b/test/child-process.js index 511d64e..0f8faeb 100644 --- a/test/child-process.js +++ b/test/child-process.js @@ -43,18 +43,16 @@ function _do_spawn(command_args, cb) { if (process.env.running_under_istanbul) { var - istanbul_path = path.join(__dirname, '..', 'node_modules', '.bin', 'istanbul'), - istanbul_args = [ - 'cover', '--report' , 'none', '--print', 'none', '--dir', path.join('coverage', 'json'), - '--include-pid', command_args[0], '--', command_args[1] - ]; - child = spawn(istanbul_path, istanbul_args); - } - else { - child = spawn(node_path, command_args); + istanbul_path = path.join(__dirname, '..', 'node_modules', 'istanbul', 'lib', 'cli.js'); + command_args = [ + istanbul_path, 'cover', '--report' , 'none', '--print', 'none', + '--dir', path.join('coverage', 'json'), '--include-pid', + command_args[0], '--', command_args[1] + ]; } // spawn doesn’t have the quoting problems that exec does, // especially when going for Windows portability. + child = spawn(node_path, command_args); child.stdin.end(); // TODO:we no longer support node 0.6 // Cannot use 'close' event because not on node-0.6. From 993c3f0dc9f7b0eec214260356ab5fa213dba788 Mon Sep 17 00:00:00 2001 From: Carsten Klein Date: Sat, 9 Dec 2017 17:04:02 +0100 Subject: [PATCH 17/27] add istanbul ignore else where missing --- lib/tmp.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/lib/tmp.js b/lib/tmp.js index 1175a4f..de13299 100644 --- a/lib/tmp.js +++ b/lib/tmp.js @@ -97,10 +97,12 @@ function _isUndefined(obj) { * @private */ function _parseArguments(options, callback) { + /* istanbul ignore else */ if (typeof options == 'function') { return [{}, options]; } + /* istanbul ignore else */ if (_isUndefined(options)) { return [{}, callback]; } @@ -116,14 +118,17 @@ function _parseArguments(options, callback) { * @private */ function _generateTmpName(opts) { + /* istanbul ignore else */ if (opts.name) { return path.join(opts.dir || tmpDir, opts.name); } // mkstemps like template + /* istanbul ignore else */ if (opts.template) { var template = opts.template; // make sure that we prepend the tmp path if none was given + /* istanbul ignore else */ if (path.basename(template) == template) template = path.join(opts.dir || tmpDir, template); return template.replace(TEMPLATE_PATTERN, _randomChars(6)); @@ -153,9 +158,11 @@ function tmpName(options, callback) { cb = args[1], tries = opts.name ? 1 : opts.tries || DEFAULT_TRIES; + /* istanbul ignore else */ if (isNaN(tries) || tries < 0) return cb(new Error('Invalid tries')); + /* istanbul ignore else */ if (opts.template && !opts.template.match(TEMPLATE_PATTERN)) return cb(new Error('Invalid template provided')); @@ -164,7 +171,9 @@ function tmpName(options, callback) { // check whether the path exists then retry if needed fs.stat(name, function (err) { + /* istanbul ignore else */ if (!err) { + /* istanbul ignore else */ if (tries-- > 0) return _getUniqueName(); return cb(new Error('Could not get a unique tmp filename, max tries reached ' + name)); @@ -188,9 +197,11 @@ function tmpNameSync(options) { opts = args[0], tries = opts.name ? 1 : opts.tries || DEFAULT_TRIES; + /* istanbul ignore else */ if (isNaN(tries) || tries < 0) throw new Error('Invalid tries'); + /* istanbul ignore else */ if (opts.template && !opts.template.match(TEMPLATE_PATTERN)) throw new Error('Invalid template provided'); @@ -222,14 +233,17 @@ function file(options, callback) { // gets a temporary filename tmpName(opts, function _tmpNameCreated(err, name) { + /* istanbul ignore else */ if (err) return cb(err); // create and open the file fs.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err, fd) { + /* istanbul ignore else */ if (err) return cb(err); if (opts.discardDescriptor) { return fs.close(fd, function _discardCallback(err) { + /* istanbul ignore else */ if (err) { // Low probability, and the file exists, so this could be // ignored. If it isn't we certainly need to unlink the @@ -247,6 +261,7 @@ function file(options, callback) { cb(null, name, undefined, _prepareTmpFileRemoveCallback(name, -1, opts)); }); } + /* istanbul ignore else */ if (opts.detachDescriptor) { return cb(null, name, fd, _prepareTmpFileRemoveCallback(name, -1, opts)); } @@ -272,6 +287,7 @@ function fileSync(options) { const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; const name = tmpNameSync(opts); var fd = fs.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); + /* istanbul ignore else */ if (opts.discardDescriptor) { fs.closeSync(fd); fd = undefined; @@ -305,6 +321,7 @@ function _rmdirRecursiveSync(root) { stat = fs.lstatSync(file); // lstat so we don't recurse into symlinked directories if (stat.isDirectory()) { + /* istanbul ignore else */ if (!deferred) { deferred = true; dirs.push(dir); @@ -315,6 +332,7 @@ function _rmdirRecursiveSync(root) { } } + /* istanbul ignore else */ if (!deferred) { fs.rmdirSync(dir); } @@ -335,10 +353,12 @@ function dir(options, callback) { // gets a temporary filename tmpName(opts, function _tmpNameCreated(err, name) { + /* istanbul ignore else */ if (err) return cb(err); // create the directory fs.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err) { + /* istanbul ignore else */ if (err) return cb(err); cb(null, name, _prepareTmpDirRemoveCallback(name, opts)); @@ -379,6 +399,7 @@ function dirSync(options) { function _prepareTmpFileRemoveCallback(name, fd, opts) { const removeCallback = _prepareRemoveCallback(function _removeCallback(fdPath) { try { + /* istanbul ignore else */ if (0 <= fdPath[0]) { fs.closeSync(fdPath[0]); } @@ -387,6 +408,7 @@ function _prepareTmpFileRemoveCallback(name, fd, opts) { // under some node/windows related circumstances, a temporary file // may have not be created as expected or the file was already closed // by the user, in which case we will simply ignore the error + /* istanbul ignore else */ if (!isEBADF(e) && !isENOENT(e)) { // reraise any unanticipated error throw e; @@ -396,6 +418,7 @@ function _prepareTmpFileRemoveCallback(name, fd, opts) { fs.unlinkSync(fdPath[1]); } catch (e) { + /* istanbul ignore else */ if (!isENOENT(e)) { // reraise any unanticipated error throw e; @@ -403,6 +426,7 @@ function _prepareTmpFileRemoveCallback(name, fd, opts) { } }, [fd, name]); + /* istanbul ignore else */ if (!opts.keep) { _removeObjects.unshift(removeCallback); } @@ -422,6 +446,7 @@ function _prepareTmpDirRemoveCallback(name, opts) { const removeFunction = opts.unsafeCleanup ? _rmdirRecursiveSync : fs.rmdirSync.bind(fs); const removeCallback = _prepareRemoveCallback(removeFunction, name); + /* istanbul ignore else */ if (!opts.keep) { _removeObjects.unshift(removeCallback); } @@ -441,8 +466,10 @@ function _prepareRemoveCallback(removeFunction, arg) { var called = false; return function _cleanupCallback(next) { + /* istanbul ignore else */ if (!called) { const index = _removeObjects.indexOf(_cleanupCallback); + /* istanbul ignore else */ if (index >= 0) { _removeObjects.splice(index, 1); } @@ -451,6 +478,7 @@ function _prepareRemoveCallback(removeFunction, arg) { removeFunction(arg); } + /* istanbul ignore else */ if (next) next(null); }; } @@ -461,6 +489,7 @@ function _prepareRemoveCallback(removeFunction, arg) { * @private */ function _garbageCollector() { + /* istanbul ignore else */ if (!_gracefulCleanup) { return; } @@ -541,13 +570,16 @@ function _safely_install_listener() { var existingListeners = []; for (var i = 0, length = listeners.length; i < length; i++) { var lstnr = listeners[i]; + /* istanbul ignore else */ if (lstnr.name == '_tmp$safe_listener' || _is_legacy_listener(lstnr)) { + /* istanbul ignore else */ if (lstnr.name != '_uncaughtExceptionThrown') existingListeners.push(lstnr); process.removeListener(EVENT, lstnr); } } process.addListener(EVENT, function _tmp$safe_listener(data) { + /* istanbul ignore else */ if (existingListeners.length) { for (var i = 0, length = existingListeners.length; i < length; i++) { existingListeners[i](data); From cb1724014a34fa1ac914c3c3b34d9e913d2215e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Mon, 25 Dec 2017 11:01:15 +0100 Subject: [PATCH 18/27] Remove unnecessary comments --- test/dir-sync-test.js | 6 ------ test/dir-test.js | 5 ----- test/file-sync-test.js | 6 ------ test/file-test.js | 6 ------ test/name-sync-test.js | 6 ------ test/name-test.js | 6 ------ 6 files changed, 35 deletions(-) diff --git a/test/dir-sync-test.js b/test/dir-sync-test.js index 91e13b1..1908296 100644 --- a/test/dir-sync-test.js +++ b/test/dir-sync-test.js @@ -17,7 +17,6 @@ tmp.setGracefulCleanup(); describe('tmp', function () { describe('#dirSync()', function () { - // API call standard inband tests describe('when running inband standard tests', function () { inbandStandardTests(false, function before() { @@ -46,12 +45,9 @@ describe('tmp', function () { }); }); - // API call issue specific inband tests describe('when running issue specific inband tests', function () { - // add your issue specific tests here }); - // API call standard outband tests describe('when running standard outband tests', function () { it('on graceful cleanup', function (done) { childProcess('graceful-dir-sync.json', function (err, stderr, stdout) { @@ -124,9 +120,7 @@ describe('tmp', function () { }); }); - // API call issue specific outband tests describe('when running issue specific outband tests', function () { - // add your issue specific tests here it('on issue #62', function (done) { childProcess('issue62-sync.json', function (err, stderr, stdout) { if (err) return done(err); diff --git a/test/dir-test.js b/test/dir-test.js index 74ce178..3f7ef29 100644 --- a/test/dir-test.js +++ b/test/dir-test.js @@ -17,7 +17,6 @@ tmp.setGracefulCleanup(); describe('tmp', function () { describe('#dir()', function () { - // API call standard inband tests describe('when running inband standard tests', function () { inbandStandardTests(false, function before(done) { @@ -47,12 +46,10 @@ describe('tmp', function () { }); }); - // API call issue specific inband tests describe('when running issue specific inband tests', function () { // add your issue specific tests here }); - // API call standard outband tests describe('when running standard outband tests', function () { it('on graceful cleanup', function (done) { childProcess('graceful-dir.json', function (err, stderr, stdout) { @@ -125,9 +122,7 @@ describe('tmp', function () { }); }); - // API call issue specific outband tests describe('when running issue specific outband tests', function () { - // add your issue specific tests here it('on issue #62', function (done) { childProcess('issue62.json', function (err, stderr, stdout) { if (err) return done(err); diff --git a/test/file-sync-test.js b/test/file-sync-test.js index d418b53..a286b6a 100644 --- a/test/file-sync-test.js +++ b/test/file-sync-test.js @@ -16,7 +16,6 @@ tmp.setGracefulCleanup(); describe('tmp', function () { describe('#fileSync()', function () { - // API call standard inband tests describe('when running inband standard tests', function () { inbandStandardTests(true, function before() { @@ -43,12 +42,9 @@ describe('tmp', function () { }); }); - // API call issue specific inband tests describe('when running issue specific inband tests', function () { - // add your issue specific tests here }); - // API call standard outband tests describe('when running standard outband tests', function () { it('on graceful', function (done) { childProcess('graceful-file-sync.json', function (err, stderr, stdout) { @@ -90,9 +86,7 @@ describe('tmp', function () { }); }); - // API call issue specific outband tests describe('when running issue specific outband tests', function () { - // add your issue specific tests here it('on issue #115', function (done) { childProcess('issue115-sync.json', function (err, stderr, stdout) { if (err) return done(err); diff --git a/test/file-test.js b/test/file-test.js index a07899c..5933e45 100644 --- a/test/file-test.js +++ b/test/file-test.js @@ -16,7 +16,6 @@ tmp.setGracefulCleanup(); describe('tmp', function () { describe('#file()', function () { - // API call standard inband tests describe('when running inband standard tests', function () { inbandStandardTests(true, function before(done) { @@ -46,12 +45,9 @@ describe('tmp', function () { }); }); - // API call issue specific inband tests describe('when running issue specific inband tests', function () { - // add your issue specific tests here }); - // API call standard outband tests describe('when running standard outband tests', function () { it('on graceful', function (done) { childProcess('graceful-file.json', function (err, stderr, stdout) { @@ -93,9 +89,7 @@ describe('tmp', function () { }); }); - // API call issue specific outband tests describe('when running issue specific outband tests', function () { - // add your issue specific tests here it('on issue #115', function (done) { childProcess('issue115.json', function (err, stderr, stdout) { if (err) return done(err); diff --git a/test/name-sync-test.js b/test/name-sync-test.js index 07dcb1b..7362898 100644 --- a/test/name-sync-test.js +++ b/test/name-sync-test.js @@ -9,7 +9,6 @@ var describe('tmp', function () { describe('#tmpNameSync()', function () { - // API call standard inband tests describe('when running inband standard tests', function () { inbandStandardTests(function before() { @@ -36,18 +35,13 @@ describe('tmp', function () { }); }); - // API call issue specific inband tests describe('when running issue specific inband tests', function () { - // add your issue specific tests here }); - // API call standard outband tests describe('when running standard outband tests', function () { }); - // API call issue specific outband tests describe('when running issue specific outband tests', function () { - // add your issue specific tests here }); }); }); diff --git a/test/name-test.js b/test/name-test.js index e8d680d..7b41e27 100644 --- a/test/name-test.js +++ b/test/name-test.js @@ -9,7 +9,6 @@ var describe('tmp', function () { describe('#tmpName()', function () { - // API call standard inband tests describe('when running inband standard tests', function () { inbandStandardTests(function before(done) { @@ -39,18 +38,13 @@ describe('tmp', function () { }); }); - // API call issue specific inband tests describe('when running issue specific inband tests', function () { - // add your issue specific tests here }); - // API call standard outband tests describe('when running standard outband tests', function () { }); - // API call issue specific outband tests describe('when running issue specific outband tests', function () { - // add your issue specific tests here }); }); }); From 9bc7f7bab6427266379f189c8103945fbbe308ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Mon, 25 Dec 2017 11:01:39 +0100 Subject: [PATCH 19/27] Whitespace fixes for readability --- test/dir-sync-test.js | 9 ++++++--- test/dir-test.js | 7 ++++++- test/file-sync-test.js | 6 ++++-- test/file-test.js | 6 +++++- test/name-sync-test.js | 1 - test/name-test.js | 2 +- 6 files changed, 22 insertions(+), 9 deletions(-) diff --git a/test/dir-sync-test.js b/test/dir-sync-test.js index 1908296..8b479f0 100644 --- a/test/dir-sync-test.js +++ b/test/dir-sync-test.js @@ -14,17 +14,14 @@ var // make sure that everything gets cleaned up tmp.setGracefulCleanup(); - describe('tmp', function () { describe('#dirSync()', function () { describe('when running inband standard tests', function () { - inbandStandardTests(false, function before() { this.topic = tmp.dirSync(this.opts); }); describe('with invalid tries', function () { - it('should result in an error on negative tries', function () { try { tmp.dirSync({ tries: -1 }); @@ -33,6 +30,7 @@ describe('tmp', function () { assert.ok(err instanceof Error); } }); + it('should result in an error on non numeric tries', function () { try { tmp.dirSync({ tries: 'nan' }); @@ -57,6 +55,7 @@ describe('tmp', function () { done(); }); }); + it('on non graceful cleanup', function (done) { childProcess('non-graceful-dir-sync.json', function (err, stderr, stdout) { if (err) return done(err); @@ -68,6 +67,7 @@ describe('tmp', function () { done(); }); }); + it('on keep', function (done) { childProcess('keep-dir-sync.json', function (err, stderr, stdout) { if (err) return done(err); @@ -79,6 +79,7 @@ describe('tmp', function () { done(); }); }); + it('on unlink (keep == false)', function (done) { childProcess('unlink-dir-sync.json', function (err, stderr, stdout) { if (err) return done(err); @@ -87,6 +88,7 @@ describe('tmp', function () { done(); }); }); + it('on unsafe cleanup', function (done) { childProcess('unsafe-sync.json', function (err, stderr, stdout) { if (err) return done(err); @@ -100,6 +102,7 @@ describe('tmp', function () { done(); }); }); + it('on non unsafe cleanup', function (done) { childProcess('non-unsafe-sync.json', function (err, stderr, stdout) { if (err) return done(err); diff --git a/test/dir-test.js b/test/dir-test.js index 3f7ef29..381e628 100644 --- a/test/dir-test.js +++ b/test/dir-test.js @@ -18,7 +18,6 @@ tmp.setGracefulCleanup(); describe('tmp', function () { describe('#dir()', function () { describe('when running inband standard tests', function () { - inbandStandardTests(false, function before(done) { var that = this; tmp.dir(this.opts, function (err, name, removeCallback) { @@ -37,6 +36,7 @@ describe('tmp', function () { done(); }); }); + it('should result in an error on non numeric tries', function (done) { tmp.dir({ tries: 'nan' }, function (err) { assert.ok(err instanceof Error, 'should have failed'); @@ -59,6 +59,7 @@ describe('tmp', function () { done(); }); }); + it('on non graceful cleanup', function (done) { childProcess('non-graceful-dir.json', function (err, stderr, stdout) { if (err) return done(err); @@ -70,6 +71,7 @@ describe('tmp', function () { done(); }); }); + it('on keep', function (done) { childProcess('keep-dir.json', function (err, stderr, stdout) { if (err) return done(err); @@ -81,6 +83,7 @@ describe('tmp', function () { done(); }); }); + it('on unlink (keep == false)', function (done) { childProcess('unlink-dir.json', function (err, stderr, stdout) { if (err) return done(err); @@ -89,6 +92,7 @@ describe('tmp', function () { done(); }); }); + it('on unsafe cleanup', function (done) { childProcess('unsafe.json', function (err, stderr, stdout) { if (err) return done(err); @@ -102,6 +106,7 @@ describe('tmp', function () { done(); }); }); + it('on non unsafe cleanup', function (done) { childProcess('non-unsafe.json', function (err, stderr, stdout) { if (err) return done(err); diff --git a/test/file-sync-test.js b/test/file-sync-test.js index a286b6a..be997c3 100644 --- a/test/file-sync-test.js +++ b/test/file-sync-test.js @@ -17,7 +17,6 @@ tmp.setGracefulCleanup(); describe('tmp', function () { describe('#fileSync()', function () { describe('when running inband standard tests', function () { - inbandStandardTests(true, function before() { this.topic = tmp.fileSync(this.opts); }); @@ -31,6 +30,7 @@ describe('tmp', function () { assert.ok(err instanceof Error); } }); + it('should result in an error on non numeric tries', function () { try { tmp.fileSync({ tries: 'nan' }); @@ -54,6 +54,7 @@ describe('tmp', function () { done(); }); }); + it('on non graceful', function (done) { childProcess('non-graceful-file-sync.json', function (err, stderr, stdout) { if (err) return done(err); @@ -65,6 +66,7 @@ describe('tmp', function () { done(); }); }); + it('on keep', function (done) { childProcess('keep-file-sync.json', function (err, stderr, stdout) { if (err) return done(err); @@ -76,6 +78,7 @@ describe('tmp', function () { done(); }); }); + it('on unlink (keep == false)', function (done) { childProcess('unlink-file-sync.json', function (err, stderr, stdout) { if (err) return done(err); @@ -98,4 +101,3 @@ describe('tmp', function () { }); }); }); - diff --git a/test/file-test.js b/test/file-test.js index 5933e45..f50095f 100644 --- a/test/file-test.js +++ b/test/file-test.js @@ -13,13 +13,13 @@ var // make sure that everything gets cleaned up tmp.setGracefulCleanup(); - describe('tmp', function () { describe('#file()', function () { describe('when running inband standard tests', function () { inbandStandardTests(true, function before(done) { var that = this; + tmp.file(this.opts, function (err, name, fd, removeCallback) { if (err) done(err); else { @@ -36,6 +36,7 @@ describe('tmp', function () { done(); }); }); + it('should result in an error on non numeric tries', function (done) { tmp.file({ tries: 'nan' }, function (err) { assert.ok(err instanceof Error, 'should have failed'); @@ -57,6 +58,7 @@ describe('tmp', function () { done(); }); }); + it('on non graceful', function (done) { childProcess('non-graceful-file.json', function (err, stderr, stdout) { if (err) return done(err); @@ -68,6 +70,7 @@ describe('tmp', function () { done(); }); }); + it('on keep', function (done) { childProcess('keep-file.json', function (err, stderr, stdout) { if (err) return done(err); @@ -79,6 +82,7 @@ describe('tmp', function () { done(); }); }); + it('on unlink (keep == false)', function (done) { childProcess('unlink-file.json', function (err, stderr, stdout) { if (err) return done(err); diff --git a/test/name-sync-test.js b/test/name-sync-test.js index 7362898..e784668 100644 --- a/test/name-sync-test.js +++ b/test/name-sync-test.js @@ -10,7 +10,6 @@ var describe('tmp', function () { describe('#tmpNameSync()', function () { describe('when running inband standard tests', function () { - inbandStandardTests(function before() { this.topic = tmp.tmpNameSync(this.opts); }); diff --git a/test/name-test.js b/test/name-test.js index 7b41e27..098b7b6 100644 --- a/test/name-test.js +++ b/test/name-test.js @@ -10,7 +10,6 @@ var describe('tmp', function () { describe('#tmpName()', function () { describe('when running inband standard tests', function () { - inbandStandardTests(function before(done) { var that = this; tmp.dir(this.opts, function (err, name) { @@ -29,6 +28,7 @@ describe('tmp', function () { done(); }); }); + it('should result in an error on non numeric tries', function (done) { tmp.tmpName({ tries: 'nan' }, function (err) { assert.ok(err instanceof Error, 'should have failed'); From 39a1ad5cd539275cca98c07cb2fc33976a5ddbcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Mon, 25 Dec 2017 11:27:42 +0100 Subject: [PATCH 20/27] Refactor childProcess starting --- test/child-process.js | 36 ++++++++++++++---------------------- test/dir-sync-test.js | 14 +++++++------- test/dir-test.js | 14 +++++++------- test/file-sync-test.js | 10 +++++----- test/file-test.js | 10 +++++----- test/issue129-test.js | 2 +- 6 files changed, 39 insertions(+), 47 deletions(-) diff --git a/test/child-process.js b/test/child-process.js index 4a2485d..2fd1466 100644 --- a/test/child-process.js +++ b/test/child-process.js @@ -6,32 +6,24 @@ var existsSync = fs.existsSync || path.existsSync, spawn = require('child_process').spawn; +module.exports.genericChildProcess = _spawnProcess('spawn-generic.js'); +module.exports.childProcess = _spawnProcess('spawn-custom.js'); -module.exports.genericChildProcess = function spawnGenericChildProcess(configFile, cb) { - var - configFilePath = path.join(__dirname, 'outband', configFile), - command_args = [path.join(__dirname, 'spawn-generic.js'), configFilePath]; - - // make sure that the config file exists - if (!existsSync(configFilePath)) - return cb(new Error('ENOENT: configFile ' + configFilePath + ' does not exist')); - - _do_spawn(command_args, cb); -}; - -module.exports.childProcess = function spawnChildProcess(configFile, cb) { - var - configFilePath = path.join(__dirname, 'outband', configFile), - command_args = [path.join(__dirname, 'spawn-custom.js'), configFilePath]; +function _spawnProcess(spawnFile) { + return function (testCase, configFile, cb) { + var + configFilePath = path.join(__dirname, 'outband', configFile), + commandArgs = [path.join(__dirname, spawnFile), configFilePath]; - // make sure that the config file exists - if (!existsSync(configFilePath)) - return cb(new Error('ENOENT: configFile ' + configFilePath + ' does not exist')); + // make sure that the config file exists + if (!existsSync(configFilePath)) + return cb(new Error('ENOENT: configFile ' + configFilePath + ' does not exist')); - _do_spawn(command_args, cb); -}; + _doSpawn(commandArgs, cb); + }; +} -function _do_spawn(command_args, cb) { +function _doSpawn(commandArgs, cb) { var node_path = process.argv[0], stdoutBufs = [], diff --git a/test/dir-sync-test.js b/test/dir-sync-test.js index 8b479f0..445ae0d 100644 --- a/test/dir-sync-test.js +++ b/test/dir-sync-test.js @@ -48,7 +48,7 @@ describe('tmp', function () { describe('when running standard outband tests', function () { it('on graceful cleanup', function (done) { - childProcess('graceful-dir-sync.json', function (err, stderr, stdout) { + childProcess(this, 'graceful-dir-sync.json', function (err, stderr, stdout) { if (err) return done(err); else if (!stderr) assert.fail('stderr expected'); else assertions.assertDoesNotExist(stdout); @@ -57,7 +57,7 @@ describe('tmp', function () { }); it('on non graceful cleanup', function (done) { - childProcess('non-graceful-dir-sync.json', function (err, stderr, stdout) { + childProcess(this, 'non-graceful-dir-sync.json', function (err, stderr, stdout) { if (err) return done(err); else if (!stderr) assert.fail('stderr expected'); else { @@ -69,7 +69,7 @@ describe('tmp', function () { }); it('on keep', function (done) { - childProcess('keep-dir-sync.json', function (err, stderr, stdout) { + childProcess(this, 'keep-dir-sync.json', function (err, stderr, stdout) { if (err) return done(err); else if (stderr) assert.fail(stderr); else { @@ -81,7 +81,7 @@ describe('tmp', function () { }); it('on unlink (keep == false)', function (done) { - childProcess('unlink-dir-sync.json', function (err, stderr, stdout) { + childProcess(this, 'unlink-dir-sync.json', function (err, stderr, stdout) { if (err) return done(err); else if (stderr) assert.fail(stderr); else assertions.assertDoesNotExist(stdout); @@ -90,7 +90,7 @@ describe('tmp', function () { }); it('on unsafe cleanup', function (done) { - childProcess('unsafe-sync.json', function (err, stderr, stdout) { + childProcess(this, 'unsafe-sync.json', function (err, stderr, stdout) { if (err) return done(err); else if (stderr) assert.fail(stderr); else { @@ -104,7 +104,7 @@ describe('tmp', function () { }); it('on non unsafe cleanup', function (done) { - childProcess('non-unsafe-sync.json', function (err, stderr, stdout) { + childProcess(this, 'non-unsafe-sync.json', function (err, stderr, stdout) { if (err) return done(err); else if (stderr) assert.fail(stderr); else { @@ -125,7 +125,7 @@ describe('tmp', function () { describe('when running issue specific outband tests', function () { it('on issue #62', function (done) { - childProcess('issue62-sync.json', function (err, stderr, stdout) { + childProcess(this, 'issue62-sync.json', function (err, stderr, stdout) { if (err) return done(err); else if (stderr) assert.fail(stderr); else assertions.assertDoesNotExist(stdout); diff --git a/test/dir-test.js b/test/dir-test.js index 381e628..8d20e3e 100644 --- a/test/dir-test.js +++ b/test/dir-test.js @@ -52,7 +52,7 @@ describe('tmp', function () { describe('when running standard outband tests', function () { it('on graceful cleanup', function (done) { - childProcess('graceful-dir.json', function (err, stderr, stdout) { + childProcess(this, 'graceful-dir.json', function (err, stderr, stdout) { if (err) return done(err); else if (!stderr) assert.fail('stderr expected'); else assertions.assertDoesNotExist(stdout); @@ -61,7 +61,7 @@ describe('tmp', function () { }); it('on non graceful cleanup', function (done) { - childProcess('non-graceful-dir.json', function (err, stderr, stdout) { + childProcess(this, 'non-graceful-dir.json', function (err, stderr, stdout) { if (err) return done(err); else if (!stderr) assert.fail('stderr expected'); else { @@ -73,7 +73,7 @@ describe('tmp', function () { }); it('on keep', function (done) { - childProcess('keep-dir.json', function (err, stderr, stdout) { + childProcess(this, 'keep-dir.json', function (err, stderr, stdout) { if (err) return done(err); else if (stderr) assert.fail(stderr); else { @@ -85,7 +85,7 @@ describe('tmp', function () { }); it('on unlink (keep == false)', function (done) { - childProcess('unlink-dir.json', function (err, stderr, stdout) { + childProcess(this, 'unlink-dir.json', function (err, stderr, stdout) { if (err) return done(err); else if (stderr) assert.fail(stderr); else assertions.assertDoesNotExist(stdout); @@ -94,7 +94,7 @@ describe('tmp', function () { }); it('on unsafe cleanup', function (done) { - childProcess('unsafe.json', function (err, stderr, stdout) { + childProcess(this, 'unsafe.json', function (err, stderr, stdout) { if (err) return done(err); else if (stderr) assert.fail(stderr); else { @@ -108,7 +108,7 @@ describe('tmp', function () { }); it('on non unsafe cleanup', function (done) { - childProcess('non-unsafe.json', function (err, stderr, stdout) { + childProcess(this, 'non-unsafe.json', function (err, stderr, stdout) { if (err) return done(err); else if (stderr) assert.fail(stderr); else { @@ -129,7 +129,7 @@ describe('tmp', function () { describe('when running issue specific outband tests', function () { it('on issue #62', function (done) { - childProcess('issue62.json', function (err, stderr, stdout) { + childProcess(this, 'issue62.json', function (err, stderr, stdout) { if (err) return done(err); else if (stderr) assert.fail(stderr); else assertions.assertDoesNotExist(stdout); diff --git a/test/file-sync-test.js b/test/file-sync-test.js index be997c3..22795fe 100644 --- a/test/file-sync-test.js +++ b/test/file-sync-test.js @@ -47,7 +47,7 @@ describe('tmp', function () { describe('when running standard outband tests', function () { it('on graceful', function (done) { - childProcess('graceful-file-sync.json', function (err, stderr, stdout) { + childProcess(this, 'graceful-file-sync.json', function (err, stderr, stdout) { if (err) return done(err); else if (!stderr) assert.fail('stderr expected'); else assertions.assertDoesNotExist(stdout); @@ -56,7 +56,7 @@ describe('tmp', function () { }); it('on non graceful', function (done) { - childProcess('non-graceful-file-sync.json', function (err, stderr, stdout) { + childProcess(this, 'non-graceful-file-sync.json', function (err, stderr, stdout) { if (err) return done(err); else if (!stderr) assert.fail('stderr expected'); else { @@ -68,7 +68,7 @@ describe('tmp', function () { }); it('on keep', function (done) { - childProcess('keep-file-sync.json', function (err, stderr, stdout) { + childProcess(this, 'keep-file-sync.json', function (err, stderr, stdout) { if (err) return done(err); else if (stderr) assert.fail(stderr); else { @@ -80,7 +80,7 @@ describe('tmp', function () { }); it('on unlink (keep == false)', function (done) { - childProcess('unlink-file-sync.json', function (err, stderr, stdout) { + childProcess(this, 'unlink-file-sync.json', function (err, stderr, stdout) { if (err) return done(err); else if (stderr) assert.fail(stderr); else assertions.assertDoesNotExist(stdout); @@ -91,7 +91,7 @@ describe('tmp', function () { describe('when running issue specific outband tests', function () { it('on issue #115', function (done) { - childProcess('issue115-sync.json', function (err, stderr, stdout) { + childProcess(this, 'issue115-sync.json', function (err, stderr, stdout) { if (err) return done(err); else if (stderr) assert.fail(stderr); else assertions.assertDoesNotExist(stdout); diff --git a/test/file-test.js b/test/file-test.js index f50095f..6597bef 100644 --- a/test/file-test.js +++ b/test/file-test.js @@ -51,7 +51,7 @@ describe('tmp', function () { describe('when running standard outband tests', function () { it('on graceful', function (done) { - childProcess('graceful-file.json', function (err, stderr, stdout) { + childProcess(this, 'graceful-file.json', function (err, stderr, stdout) { if (err) return done(err); else if (!stderr) assert.fail('stderr expected'); else assertions.assertDoesNotExist(stdout); @@ -60,7 +60,7 @@ describe('tmp', function () { }); it('on non graceful', function (done) { - childProcess('non-graceful-file.json', function (err, stderr, stdout) { + childProcess(this, 'non-graceful-file.json', function (err, stderr, stdout) { if (err) return done(err); else if (!stderr) assert.fail('stderr expected'); else { @@ -72,7 +72,7 @@ describe('tmp', function () { }); it('on keep', function (done) { - childProcess('keep-file.json', function (err, stderr, stdout) { + childProcess(this, 'keep-file.json', function (err, stderr, stdout) { if (err) return done(err); else if (stderr) assert.fail(stderr); else { @@ -84,7 +84,7 @@ describe('tmp', function () { }); it('on unlink (keep == false)', function (done) { - childProcess('unlink-file.json', function (err, stderr, stdout) { + childProcess(this, 'unlink-file.json', function (err, stderr, stdout) { if (err) return done(err); else if (stderr) assert.fail(stderr); else assertions.assertDoesNotExist(stdout); @@ -95,7 +95,7 @@ describe('tmp', function () { describe('when running issue specific outband tests', function () { it('on issue #115', function (done) { - childProcess('issue115.json', function (err, stderr, stdout) { + childProcess(this, 'issue115.json', function (err, stderr, stdout) { if (err) return done(err); else if (stderr) assert.fail(stderr); else assertions.assertDoesNotExist(stdout); diff --git a/test/issue129-test.js b/test/issue129-test.js index 14a6679..50af325 100644 --- a/test/issue129-test.js +++ b/test/issue129-test.js @@ -9,7 +9,7 @@ var describe('tmp', function () { describe('issue129: safely install listeners', function () { it('when simulating sandboxed behavior', function (done) { - childProcess('issue129.json', function (err, stderr) { + childProcess(this, 'issue129.json', function (err, stderr) { if (err) return done(err); else if (stderr) { assertions.assertDoesNotStartWith(stderr, 'EEXISTS:LEGACY:EXIT'); From a1544cf3f92fd1c34b817fa4f9685c09f2265f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Mon, 25 Dec 2017 18:52:28 +0100 Subject: [PATCH 21/27] Indenting and naming fixes --- test/child-process.js | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/test/child-process.js b/test/child-process.js index 2fd1466..315671e 100644 --- a/test/child-process.js +++ b/test/child-process.js @@ -36,39 +36,45 @@ function _doSpawn(commandArgs, cb) { if (process.env.running_under_istanbul) { var istanbul_path = path.join(__dirname, '..', 'node_modules', 'istanbul', 'lib', 'cli.js'); - command_args = [ - istanbul_path, 'cover', '--report' , 'none', '--print', 'none', - '--dir', path.join('coverage', 'json'), '--include-pid', - command_args[0], '--', command_args[1] - ]; + commandArgs = [ + istanbul_path, 'cover', '--report' , 'none', '--print', 'none', + '--dir', path.join('coverage', 'json'), '--include-pid', + commandArgs[0], '--', commandArgs[1] + ]; } // spawn doesn’t have the quoting problems that exec does, // especially when going for Windows portability. - child = spawn(node_path, command_args); + + child = spawn(node_path, commandArgs); child.stdin.end(); // TODO:we no longer support node 0.6 // Cannot use 'close' event because not on node-0.6. + function _close() { var stderr = _bufferConcat(stderrBufs).toString(), stdout = _bufferConcat(stdoutBufs).toString(); + if (stderrDone && stdoutDone && !done) { done = true; cb(null, stderr, stdout); } } + child.on('error', function _spawnError(err) { if (!done) { done = true; cb(err); } }); + child.stdout.on('data', function _stdoutData(data) { stdoutBufs.push(data); }).on('close', function _stdoutEnd() { stdoutDone = true; _close(); }); + child.stderr.on('data', function _stderrData(data) { stderrBufs.push(data); }).on('close', function _stderrEnd() { @@ -80,13 +86,13 @@ function _doSpawn(commandArgs, cb) { function _bufferConcat(buffers) { if (Buffer.concat) { return Buffer.concat.apply(this, arguments); - } else { - return new Buffer(buffers.reduce(function (acc, buf) { - for (var i = 0; i < buf.length; i++) { - acc.push(buf[i]); - } - return acc; - }, [])); } + + return new Buffer(buffers.reduce(function (acc, buf) { + for (var i = 0; i < buf.length; i++) { + acc.push(buf[i]); + } + return acc; + }, [])); } From 8dd9d5f66675976768b6a5169f067eccb195590a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Mon, 25 Dec 2017 18:58:18 +0100 Subject: [PATCH 22/27] Switch from sync to async path check --- test/child-process.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/child-process.js b/test/child-process.js index 315671e..df0c291 100644 --- a/test/child-process.js +++ b/test/child-process.js @@ -3,7 +3,7 @@ var fs = require('fs'), path = require('path'), - existsSync = fs.existsSync || path.existsSync, + exists = fs.exists || path.exists, spawn = require('child_process').spawn; module.exports.genericChildProcess = _spawnProcess('spawn-generic.js'); @@ -15,11 +15,11 @@ function _spawnProcess(spawnFile) { configFilePath = path.join(__dirname, 'outband', configFile), commandArgs = [path.join(__dirname, spawnFile), configFilePath]; - // make sure that the config file exists - if (!existsSync(configFilePath)) - return cb(new Error('ENOENT: configFile ' + configFilePath + ' does not exist')); + exists(configFilePath, function (configExists) { + if (configExists) return _doSpawn(commandArgs, cb); - _doSpawn(commandArgs, cb); + cb(new Error('ENOENT: configFile ' + configFilePath + ' does not exist')); + }); }; } From ee21ae805f23229b8cbf5634f63363d09b4be054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Mon, 25 Dec 2017 18:58:42 +0100 Subject: [PATCH 23/27] Make istanbul path constant --- test/child-process.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/child-process.js b/test/child-process.js index df0c291..f38e7ba 100644 --- a/test/child-process.js +++ b/test/child-process.js @@ -6,6 +6,8 @@ var exists = fs.exists || path.exists, spawn = require('child_process').spawn; +const ISTANBUL_PATH = path.join(__dirname, '..', 'node_modules', 'istanbul', 'lib', 'cli.js'); + module.exports.genericChildProcess = _spawnProcess('spawn-generic.js'); module.exports.childProcess = _spawnProcess('spawn-custom.js'); @@ -35,9 +37,8 @@ function _doSpawn(commandArgs, cb) { if (process.env.running_under_istanbul) { var - istanbul_path = path.join(__dirname, '..', 'node_modules', 'istanbul', 'lib', 'cli.js'); commandArgs = [ - istanbul_path, 'cover', '--report' , 'none', '--print', 'none', + ISTANBUL_PATH, 'cover', '--report' , 'none', '--print', 'none', '--dir', path.join('coverage', 'json'), '--include-pid', commandArgs[0], '--', commandArgs[1] ]; From b87011dc29b6ff4b8d45b9ea5ca00f9969b1565a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Mon, 25 Dec 2017 19:09:36 +0100 Subject: [PATCH 24/27] Fix variable shadowing --- test/child-process.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/child-process.js b/test/child-process.js index f38e7ba..18b007a 100644 --- a/test/child-process.js +++ b/test/child-process.js @@ -36,12 +36,11 @@ function _doSpawn(commandArgs, cb) { stdoutDone = false; if (process.env.running_under_istanbul) { - var - commandArgs = [ - ISTANBUL_PATH, 'cover', '--report' , 'none', '--print', 'none', - '--dir', path.join('coverage', 'json'), '--include-pid', - commandArgs[0], '--', commandArgs[1] - ]; + commandArgs = [ + ISTANBUL_PATH, 'cover', '--report' , 'none', '--print', 'none', + '--dir', path.join('coverage', 'json'), '--include-pid', + commandArgs[0], '--', commandArgs[1] + ]; } // spawn doesn’t have the quoting problems that exec does, // especially when going for Windows portability. From 7661534383d847123742f816cc3a87bad27134a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Mon, 25 Dec 2017 19:21:24 +0100 Subject: [PATCH 25/27] Increase timeout --- test/child-process.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/child-process.js b/test/child-process.js index 18b007a..2489838 100644 --- a/test/child-process.js +++ b/test/child-process.js @@ -13,6 +13,8 @@ module.exports.childProcess = _spawnProcess('spawn-custom.js'); function _spawnProcess(spawnFile) { return function (testCase, configFile, cb) { + testCase.timeout(5000); + var configFilePath = path.join(__dirname, 'outband', configFile), commandArgs = [path.join(__dirname, spawnFile), configFilePath]; From da9fe6da98dea3ed7aef302b34c9a49116943cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Mon, 25 Dec 2017 19:30:29 +0100 Subject: [PATCH 26/27] Reorder npm tasks --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 26f499d..5dcc1fd 100644 --- a/package.json +++ b/package.json @@ -37,8 +37,8 @@ ], "scripts": { "lint": "eslint lib --env mocha test", - "test": "istanbul cover ./node_modules/mocha/bin/_mocha --report none --print none --dir ./coverage/json -u exports -R test/*-test.js && istanbul report --root ./coverage/json html && istanbul report text-summary", "clean": "rm -Rf ./coverage", + "test": "istanbul cover ./node_modules/mocha/bin/_mocha --report none --print none --dir ./coverage/json -u exports -R test/*-test.js && istanbul report --root ./coverage/json html && istanbul report text-summary", "doc": "jsdoc -c .jsdoc.json" } } From ea2fc5d0cf86c46e67d58fe3a0a7d0b2647695e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Mon, 25 Dec 2017 19:55:23 +0100 Subject: [PATCH 27/27] Style fixes --- test/child-process.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/child-process.js b/test/child-process.js index 2489838..3dd0dde 100644 --- a/test/child-process.js +++ b/test/child-process.js @@ -44,14 +44,14 @@ function _doSpawn(commandArgs, cb) { commandArgs[0], '--', commandArgs[1] ]; } + // spawn doesn’t have the quoting problems that exec does, // especially when going for Windows portability. - child = spawn(node_path, commandArgs); child.stdin.end(); - // TODO:we no longer support node 0.6 - // Cannot use 'close' event because not on node-0.6. + // TODO we no longer support node 0.6 + // Cannot use 'close' event because not on node-0.6. function _close() { var stderr = _bufferConcat(stderrBufs).toString(),