diff --git a/js.json b/js.json index 64842112..30e9c911 100644 --- a/js.json +++ b/js.json @@ -19,7 +19,7 @@ }, "lib": "libs", "gaugeVersionSupport": { - "minimum": "0.9.8", + "minimum": "0.9.7", "maximum": "" }, "lspLangId" : "javascript" diff --git a/package-lock.json b/package-lock.json index 4a8887d8..3f7b5557 100644 --- a/package-lock.json +++ b/package-lock.json @@ -68,21 +68,17 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.57.tgz", "integrity": "sha512-ZxrhcBxlZA7tn0HFf7ebUYfR9aHyBgjyavBLzyrYMYuAMbONBPY4S5O35562iV2FfwnZCjQky3gTDy1B3jSZ2Q==" }, - "JSV": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz", - "integrity": "sha1-0Hf2glVx+CEy+d/67Vh7QCn+/1c=", - "dev": true - }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "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=" + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true }, "archiver": { "version": "2.1.0", @@ -123,10 +119,23 @@ "sprintf-js": "1.0.3" } }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=" + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "requires": { + "arr-flatten": "1.1.0" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=" }, "assertion-error": { "version": "1.0.2", @@ -184,6 +193,16 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } + }, "browser-stdout": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", @@ -196,25 +215,6 @@ "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", "dev": true }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" - }, - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" - }, - "camelcase-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", - "requires": { - "camelcase": "2.1.1", - "map-obj": "1.0.1" - } - }, "chai": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chai/-/chai-4.1.2.tgz", @@ -233,6 +233,7 @@ "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", @@ -326,16 +327,6 @@ "date-now": "0.1.4" } }, - "console-stamp": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/console-stamp/-/console-stamp-0.2.6.tgz", - "integrity": "sha512-7l2MJ93tXpCWh9n5rRJHu7tNMxa9SPx8pba8kBJDROOfMFVBHPpqv141lkhcnLEYMC5npvrywH7gZ5DzYE+cSg==", - "requires": { - "chalk": "1.1.3", - "dateformat": "1.0.12", - "merge": "1.2.0" - } - }, "core-js": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.1.tgz", @@ -375,14 +366,6 @@ "source-map-support": "0.4.18" } }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "requires": { - "array-find-index": "1.0.2" - } - }, "cycle": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", @@ -395,15 +378,6 @@ "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", "dev": true }, - "dateformat": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz", - "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=", - "requires": { - "get-stdin": "4.0.1", - "meow": "3.7.0" - } - }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", @@ -413,11 +387,6 @@ "ms": "2.0.0" } }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - }, "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", @@ -508,18 +477,11 @@ "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", "dev": true }, - "error-ex": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", - "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", - "requires": { - "is-arrayish": "0.2.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=" + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true }, "escodegen": { "version": "1.9.0", @@ -561,6 +523,30 @@ "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", "dev": true }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "requires": { + "is-posix-bracket": "0.1.1" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "requires": { + "fill-range": "2.2.3" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "requires": { + "is-extglob": "1.0.0" + } + }, "eyes": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", @@ -572,13 +558,34 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=" + }, + "fill-range": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", + "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "requires": { + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "1.1.7", + "repeat-element": "1.1.2", + "repeat-string": "1.6.1" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" + "for-in": "1.0.2" } }, "formatio": { @@ -613,11 +620,6 @@ "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", "dev": true }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=" - }, "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", @@ -632,10 +634,28 @@ "path-is-absolute": "1.0.1" } }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "requires": { + "glob-parent": "2.0.0", + "is-glob": "2.0.1" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "requires": { + "is-glob": "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=" + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true }, "graceful-readlink": { "version": "1.0.1", @@ -653,6 +673,7 @@ "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" } @@ -675,11 +696,6 @@ "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", "dev": true }, - "hosted-git-info": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", - "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==" - }, "htmlparser2": { "version": "3.8.3", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", @@ -725,14 +741,6 @@ "integrity": "sha1-2WyScyB28HJxG2sQ/X1PZa2O4j0=", "dev": true }, - "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", - "requires": { - "repeating": "2.0.1" - } - }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -755,37 +763,78 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=" + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "requires": { + "is-primitive": "2.0.0" + } }, - "is-builtin-module": { + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" + }, + "is-extglob": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "requires": { - "builtin-modules": "1.1.1" + "is-extglob": "1.0.0" } }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", "requires": { - "number-is-nan": "1.0.1" + "kind-of": "3.2.2" } }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=" + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=" + }, "is-utf8": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "requires": { + "isarray": "1.0.0" + } }, "isstream": { "version": "0.1.2", @@ -949,18 +998,24 @@ "nomnom": "1.8.1" } }, + "JSV": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz", + "integrity": "sha1-0Hf2glVx+CEy+d/67Vh7QCn+/1c=", + "dev": true + }, "just-extend": { "version": "1.1.27", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-1.1.27.tgz", "integrity": "sha512-mJVp13Ix6gFo3SBAy9U/kL+oeZqzlYYYLQBwXVBlVzIsZwBqGREnOro24oC/8s8aox+rJhtZ2DiQof++IrkA+g==", "dev": true }, - "klaw-sync": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-3.0.2.tgz", - "integrity": "sha512-32bw9y2nKrnpX2LsJnDTBO2TSdOKPbXfQAWl7Lupcc3D0iKkzI/sQDEw1GjkOuTqZEhe+bVxKSlhSRLxyeytcw==", + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "graceful-fs": "4.1.11" + "is-buffer": "1.1.6" } }, "lazystream": { @@ -981,18 +1036,6 @@ "type-check": "0.3.2" } }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "strip-bom": "2.0.0" - } - }, "lodash": { "version": "4.17.4", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", @@ -1016,49 +1059,26 @@ "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=" }, - "loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "requires": { - "currently-unhandled": "0.4.1", - "signal-exit": "3.0.2" - } - }, - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" - }, - "meow": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", - "requires": { - "camelcase-keys": "2.1.0", - "decamelize": "1.2.0", - "loud-rejection": "1.6.0", - "map-obj": "1.0.1", - "minimist": "1.2.0", - "normalize-package-data": "2.4.0", - "object-assign": "4.1.1", - "read-pkg-up": "1.0.1", - "redent": "1.0.0", - "trim-newlines": "1.0.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" - } + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.4" } }, - "merge": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz", - "integrity": "sha1-dTHjnUlJwoGma4xabgJl6LBYlNo=" - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -1118,12 +1138,6 @@ } } }, - "mock-fs": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.4.2.tgz", - "integrity": "sha512-dF+yxZSojSiI8AXGoxj5qdFWpucndc54Ug+TwlpHFaV7j22MGG+OML2+FVa6xAZtjb/OFFQhOC37Jegx2GbEwA==", - "dev": true - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -1204,35 +1218,22 @@ } } }, - "normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", - "requires": { - "hosted-git-info": "2.6.0", - "is-builtin-module": "1.0.0", - "semver": "5.5.0", - "validate-npm-package-license": "3.0.3" - } - }, "normalize-path": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, "requires": { "remove-trailing-separator": "1.1.0" } }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "requires": { + "for-own": "0.1.5", + "is-extendable": "0.1.1" + } }, "once": { "version": "1.4.0", @@ -1256,20 +1257,15 @@ "wordwrap": "1.0.0" } }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "requires": { - "error-ex": "1.3.1" - } - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", "requires": { - "pinkie-promise": "2.0.1" + "glob-base": "0.3.0", + "is-dotfile": "1.0.3", + "is-extglob": "1.0.0", + "is-glob": "2.0.1" } }, "path-is-absolute": { @@ -1301,40 +1297,12 @@ } } }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "requires": { - "graceful-fs": "4.1.11", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" - } - }, "pathval": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", "dev": true }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "requires": { - "pinkie": "2.0.4" - } - }, "pkginfo": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.4.1.tgz", @@ -1346,6 +1314,11 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=" + }, "process-nextick-args": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", @@ -1390,6 +1363,43 @@ "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" }, + "randomatic": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", + "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, "read": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", @@ -1399,25 +1409,6 @@ "mute-stream": "0.0.7" } }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "requires": { - "load-json-file": "1.1.0", - "normalize-package-data": "2.4.0", - "path-type": "1.1.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "requires": { - "find-up": "1.1.2", - "read-pkg": "1.1.0" - } - }, "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", @@ -1433,34 +1424,34 @@ "util-deprecate": "1.0.2" } }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", - "requires": { - "indent-string": "2.1.0", - "strip-indent": "1.0.1" - } - }, "regenerator-runtime": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", "dev": true }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "requires": { + "is-equal-shallow": "0.1.3" + } + }, "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "requires": { - "is-finite": "1.0.2" - } + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=" + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" }, "reserved-words": { "version": "0.1.2", @@ -1504,22 +1495,12 @@ "integrity": "sha512-1HwIYD/8UlOtFS3QO3w7ey+SdSDFE4HRNLZoZRYVQefrOY3l17epswImeB1ijgJFQJodIaHcwkp3r/myBjFVbg==", "dev": true }, - "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" - }, "shelljs": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=", "dev": true }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" - }, "sinon": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/sinon/-/sinon-4.1.3.tgz", @@ -1560,34 +1541,6 @@ "source-map": "0.5.7" } }, - "spdx-correct": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", - "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", - "requires": { - "spdx-expression-parse": "3.0.0", - "spdx-license-ids": "3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", - "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==" - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "requires": { - "spdx-exceptions": "2.1.0", - "spdx-license-ids": "3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", - "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==" - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -1613,6 +1566,7 @@ "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" } @@ -1621,18 +1575,11 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, "requires": { "is-utf8": "0.2.1" } }, - "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", - "requires": { - "get-stdin": "4.0.1" - } - }, "strip-json-comments": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", @@ -1642,7 +1589,8 @@ "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true }, "tar-stream": { "version": "1.5.5", @@ -1674,11 +1622,6 @@ "integrity": "sha1-fMKRUfD18sQZRvEZ9ZMv5VQXASU=", "dev": true }, - "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=" - }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -1750,15 +1693,6 @@ "resolved": "https://registry.npmjs.org/valid-identifier/-/valid-identifier-0.0.1.tgz", "integrity": "sha1-7x1wk6nTKH4/zpLfkW+GFrI/kLQ=" }, - "validate-npm-package-license": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", - "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", - "requires": { - "spdx-correct": "3.0.0", - "spdx-expression-parse": "3.0.0" - } - }, "vow": { "version": "0.4.17", "resolved": "https://registry.npmjs.org/vow/-/vow-0.4.17.tgz", diff --git a/src/file-util.js b/src/file-util.js index 57de0d9f..6fdced61 100644 --- a/src/file-util.js +++ b/src/file-util.js @@ -2,18 +2,17 @@ var fs = require("fs"); var path = require("path"); var klawSync = require("klaw-sync"); -function isJSFile(file) { - return path.extname(file) === ".js"; +function isJSFile(item) { + return path.extname(item.path) === ".js"; } function collectFilesIn(dir) { - return klawSync(dir, { filter: function (item) { return isJSFile(item.path); } }).map(function (item) { + return klawSync(dir, { filter: isJSFile }).map(function (item) { return item.path; }); } -function getImplDirs() { - const projectRoot = process.env.GAUGE_PROJECT_ROOT; +function getImplDirs(projectRoot) { if (process.env.STEP_IMPL_DIR) { return process.env.STEP_IMPL_DIR.split(",").map(function (dir) { return path.join(projectRoot, dir.trim()); @@ -23,8 +22,8 @@ function getImplDirs() { } -function getListOfFiles() { - var results = getImplDirs().reduce(function (files, dir) { +function getListOfFiles(projectRoot) { + var results = getImplDirs(projectRoot).reduce(function (files, dir) { if (!fs.existsSync(dir)) { console.log("Failed to load implementations from " + dir); return files; @@ -47,19 +46,9 @@ function getFileName(dir, counter = 0) { return getFileName(dir, ++counter); } -function isInImplDir(filePath) { - return getImplDirs().findIndex((implDir) => { - if (path.normalize(filePath).startsWith(path.normalize(implDir))) { - return true; - } - }) !== -1; -} - module.exports = { getImplDirs: getImplDirs, getListOfFiles: getListOfFiles, isSameFilePath: isSameFilePath, - getFileName: getFileName, - isJSFile: isJSFile, - isInImplDir: isInImplDir + getFileName: getFileName }; diff --git a/src/gauge.js b/src/gauge.js index 3711b688..e329d774 100755 --- a/src/gauge.js +++ b/src/gauge.js @@ -6,6 +6,7 @@ var loader = require("./static-loader"); var consoleStamp = require("console-stamp"); var GAUGE_INTERNAL_PORT = process.env.GAUGE_INTERNAL_PORT; +var GAUGE_PROJECT_ROOT = process.env.GAUGE_PROJECT_ROOT; function run() { if (process.env.IS_DAEMON) { @@ -14,8 +15,7 @@ function run() { protobuf.load(path.resolve("gauge-proto/messages.proto")).then(function (root) { var message = root.lookupType("gauge.messages.Message"); var errorType = root.lookupEnum("gauge.messages.StepValidateResponse.ErrorType"); - var fileStatus = root.lookupEnum("gauge.messages.CacheFileRequest.FileStatus"); - return { message: message, errorType: errorType, fileStatus: fileStatus }; + return { message: message, errorType: errorType }; }).catch(function (e) { console.error("Failed while loading runner.\n", e); process.exit(); @@ -23,7 +23,7 @@ function run() { var gaugeInternalConnection = new Connection("localhost", GAUGE_INTERNAL_PORT, types.message); gaugeInternalConnection.run(); - loader.load(); + loader.load(GAUGE_PROJECT_ROOT); var processor = new MessageProcessor(types); diff --git a/src/impl-loader.js b/src/impl-loader.js index 8731e394..1d51bf6a 100644 --- a/src/impl-loader.js +++ b/src/impl-loader.js @@ -1,9 +1,9 @@ var fileUtil = require("./file-util"), VM = require("./vm"); -function loadImpl() { +function loadImpl(projectRoot) { var vm = new VM(); - fileUtil.getListOfFiles().forEach(function(filePath) { + fileUtil.getListOfFiles(projectRoot).forEach(function(filePath) { process.env.GAUGE_STEPFILEPATH = filePath; vm.contextify(filePath, process.env.GAUGE_PROJECT_ROOT); vm.runFile(filePath); diff --git a/src/message-processor.js b/src/message-processor.js index d24f9f77..47c78ecc 100644 --- a/src/message-processor.js +++ b/src/message-processor.js @@ -60,7 +60,7 @@ function executeHook(request, hookName, currentExecutionInfo) { } function startExecution(self, request) { - impl_loader.load(); + impl_loader.load(GAUGE_PROJECT_ROOT); executeHook.apply(self, [request, "beforeSuite", request.executionStartingRequest.currentExecutionInfo]); } @@ -171,7 +171,7 @@ var executeStepPositionsRequest = function (request) { var getImplementationFiles = function (request) { var response = factory.createImplementationFileListResponse(this.options.message, request.messageId); - var files = fileUtil.getListOfFiles(); + var files = fileUtil.getListOfFiles(GAUGE_PROJECT_ROOT); response.implementationFileListResponse.implementationFilePaths = files; this._emit(response); }; @@ -214,20 +214,14 @@ var executeRefactor = function (request) { }; var executeCacheFileRequest = function (request) { - const filePath = request.cacheFileRequest.filePath; - if (!fileUtil.isJSFile(filePath) || !fileUtil.isInImplDir(filePath)) { - return; - } - if (request.cacheFileRequest.status === this.options.fileStatus.values.CREATED) { - loader.reloadFile(filePath, fs.readFileSync(filePath, "UTF-8")); - } else if (request.cacheFileRequest.status === this.options.fileStatus.values.CHANGED || - request.cacheFileRequest.status === this.options.fileStatus.values.OPENED) { - loader.reloadFile(filePath, request.cacheFileRequest.content); - } else if (request.cacheFileRequest.status === this.options.fileStatus.values.CLOSED && - fs.existsSync(filePath)) { - loader.reloadFile(filePath, fs.readFileSync(filePath, "UTF-8")); + if (!request.cacheFileRequest.isClosed) { + loader.reloadFile(request.cacheFileRequest.filePath, request.cacheFileRequest.content); } else { - loader.unloadFile(filePath); + if (fs.existsSync(request.cacheFileRequest.filePath)) { + loader.reloadFile(request.cacheFileRequest.filePath, fs.readFileSync(request.cacheFileRequest.filePath, "UTF-8")); + } else { + loader.unloadFile(request.cacheFileRequest.filePath); + } } }; diff --git a/src/static-loader.js b/src/static-loader.js index aa5b58c1..f7cb2ba1 100644 --- a/src/static-loader.js +++ b/src/static-loader.js @@ -60,8 +60,8 @@ function createAst(content) { } } -function loadFiles() { - fileUtil.getListOfFiles().forEach(function (filePath) { +function loadFiles(projectRoot) { + fileUtil.getListOfFiles(projectRoot).forEach(function (filePath) { var ast = createAst(fs.readFileSync(filePath, "UTF-8")); if (ast) { loadFile(filePath, ast); diff --git a/test/file-util-test.js b/test/file-util-test.js index 4b7501be..ac39e03d 100644 --- a/test/file-util-test.js +++ b/test/file-util-test.js @@ -65,8 +65,7 @@ describe("File util functions", function () { }, }, }); - process.env.GAUGE_PROJECT_ROOT = process.cwd(); - var files = fileUtil.getListOfFiles(); + var files = fileUtil.getListOfFiles(process.cwd()); assert.equal(files.length, 2); }); @@ -80,8 +79,7 @@ describe("File util functions", function () { }, } }); - process.env.GAUGE_PROJECT_ROOT = process.cwd(); - var files = fileUtil.getListOfFiles(); + var files = fileUtil.getListOfFiles(process.cwd()); assert.equal(files.length, 2); }); @@ -95,8 +93,7 @@ describe("File util functions", function () { }, } }); - process.env.GAUGE_PROJECT_ROOT = process.cwd(); - var files = fileUtil.getListOfFiles(); + var files = fileUtil.getListOfFiles(process.cwd()); assert.equal(files.length, 0); }); @@ -118,8 +115,7 @@ describe("File util functions", function () { } }); process.env.STEP_IMP_DIR = "custom"; - process.env.GAUGE_PROJECT_ROOT = process.cwd(); - var files = fileUtil.getListOfFiles(); + var files = fileUtil.getListOfFiles(process.cwd()); assert.equal(files.length, 2); }); }); @@ -162,51 +158,4 @@ describe("File util functions", function () { assert.equal(path.basename(file), "step-implementation-2.js"); }); }); - - describe("isInImplDir", function () { - afterEach(function () { - mock.restore(); - }); - - it("should be true if file is under implementation dir", function () { - mock({ - "tests": { - "step-impl.js": "file content" - }, - }); - process.env.GAUGE_PROJECT_ROOT = process.cwd(); - assert.isTrue(fileUtil.isInImplDir(path.join(process.cwd(), "tests", "step-impl.js"))); - }); - - it("should be true if file in nested dir under implementation dir", function () { - mock({ - "tests": { - "inner-dir": { - "step-impl.js": "file content", - } - }, - }); - process.env.GAUGE_PROJECT_ROOT = process.cwd(); - assert.isTrue(fileUtil.isInImplDir(path.join(process.cwd(), "tests", "inner-dir", "step-impl.js"))); - }); - - it("should be false if file is not under implementation dir", function () { - mock({ - "tests": { - "inner-dir": { - "step-impl.js": "file content", - } - }, - }); - process.env.GAUGE_PROJECT_ROOT = process.cwd(); - assert.isFalse(fileUtil.isInImplDir(path.join(process.cwd(), "step-impl.js"))); - }); - }); - - describe("isJSFile", function () { - it("should check for js file extensions", function () { - assert.isTrue(fileUtil.isJSFile("step-impl.js")); - assert.isFalse(fileUtil.isJSFile("step-impl.java")); - }); - }); }); diff --git a/test/message-processor-test.js b/test/message-processor-test.js index a2f71bad..9618712b 100644 --- a/test/message-processor-test.js +++ b/test/message-processor-test.js @@ -5,10 +5,9 @@ var esprima = require("esprima"); var stepRegistry = require("../src/step-registry"); var loader = require("../src/static-loader"); var MessageProcessor = require("../src/message-processor"); -var mock = require("mock-fs"); -var path = require("path"); describe("Step Validate Request Processing", function () { + var stepValidateRequest = []; var message = null; this.timeout(10000); @@ -89,6 +88,7 @@ describe("Step Validate Request Processing", function () { }); processor.getResponseFor(stepValidateRequest[0]); }); + }); describe("StepNameRequest Processing", function () { @@ -199,103 +199,3 @@ describe("StepPositionsRequest Processing", function () { processor.getResponseFor(stepPositionsRequest); }); }); - -describe("CacheFileRequest Processing", function () { - var message = null; - var fileStatus = null; - var filePath = path.join(process.cwd(), "tests", "example.js"); - var fileContent = "\"use strict\";\n" + - "var assert = require(\"assert\");\n" + - "var vowels = require(\"./vowels\");\n" + - "step(\"Vowels in English language are .\", function(vowelsGiven) {\n" + - " assert.equal(vowelsGiven, vowels.vowelList.join(\"\"));\n" + - "});"; - this.timeout(10000); - - var getCacheFileRequestMessage = function (filePath, status) { - return message.create({ - messageId: 1, - messageType: message.MessageType.CacheFileRequest, - cacheFileRequest: { - filePath: filePath, - status: status - } - }); - }; - - before(function (done) { - process.env.GAUGE_PROJECT_ROOT = process.cwd(); - stepRegistry.clear(); - protobuf.load("gauge-proto/messages.proto").then(function (root) { - message = root.lookupType("gauge.messages.Message"); - fileStatus = root.lookupType("gauge.messages.CacheFileRequest").FileStatus; - done(); - }); - }); - - afterEach(function () { - mock.restore(); - }); - - it("should reload files on create", function () { - var cacheFileRequest = getCacheFileRequestMessage(filePath, fileStatus.CREATED); - mock({ - "tests": { - "example.js": fileContent - } - }); - - var processor = new MessageProcessor({ message: message, errorType: { values: {} }, fileStatus: { values: { CHANGED: 0, CLOSED: 1, CREATED: 2, DELETED: 3, OPENED: 4 } } }); - processor.getResponseFor(cacheFileRequest); - assert.isNotEmpty(stepRegistry.get("Vowels in English language are {}.")); - }); - - it("should unload file on delete.", function () { - var cacheFileRequest = getCacheFileRequestMessage(filePath, fileStatus.DELETED); - loader.reloadFile(filePath, fileContent); - assert.isNotEmpty(stepRegistry.get("Vowels in English language are {}.")); - var processor = new MessageProcessor({ message: message, errorType: { values: {} }, fileStatus: { values: { CHANGED: 0, CLOSED: 1, CREATED: 2, DELETED: 3, OPENED: 4 } } }); - processor.getResponseFor(cacheFileRequest); - assert.isUndefined(stepRegistry.get("Vowels in English language are {}.")); - }); - - it("should reload file from disk on closed.", function () { - var cacheFileRequest = getCacheFileRequestMessage(filePath, fileStatus.CLOSED); - mock({ - "tests": { - "example.js": fileContent - } - }); - loader.reloadFile(filePath, fileContent); - var processor = new MessageProcessor({ message: message, errorType: { values: {} }, fileStatus: { values: { CHANGED: 0, CLOSED: 1, CREATED: 2, DELETED: 3, OPENED: 4 } } }); - processor.getResponseFor(cacheFileRequest); - assert.isNotEmpty(stepRegistry.get("Vowels in English language are {}.")); - }); - - it("should unload file from disk on closed and file does not exists.", function () { - var cacheFileRequest = getCacheFileRequestMessage(filePath, fileStatus.CLOSED); - mock({ - "tests": {} - }); - loader.reloadFile(filePath, fileContent); - var processor = new MessageProcessor({ message: message, errorType: { values: {} }, fileStatus: { values: { CHANGED: 0, CLOSED: 1, CREATED: 2, DELETED: 3, OPENED: 4 } } }); - processor.getResponseFor(cacheFileRequest); - assert.isUndefined(stepRegistry.get("Vowels in English language are {}.")); - }); - - it("should load changed content on file opened", function () { - var cacheFileRequest = getCacheFileRequestMessage(filePath, fileStatus.OPENED); - cacheFileRequest.cacheFileRequest.content = fileContent; - var processor = new MessageProcessor({ message: message, errorType: { values: {} }, fileStatus: { values: { CHANGED: 0, CLOSED: 1, CREATED: 2, DELETED: 3, OPENED: 4 } } }); - processor.getResponseFor(cacheFileRequest); - assert.isNotEmpty(stepRegistry.get("Vowels in English language are {}.")); - }); - - it("should load changed content on file changed", function () { - var cacheFileRequest = getCacheFileRequestMessage(filePath, fileStatus.OPENED); - cacheFileRequest.cacheFileRequest.content = fileContent; - var processor = new MessageProcessor({ message: message, errorType: { values: {} }, fileStatus: { values: { CHANGED: 0, CLOSED: 1, CREATED: 2, DELETED: 3, OPENED: 4 } } }); - processor.getResponseFor(cacheFileRequest); - assert.isNotEmpty(stepRegistry.get("Vowels in English language are {}.")); - }); -}); \ No newline at end of file