diff --git a/package.json b/package.json index d98d822..c1c5079 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@klenty/gunner", - "version": "0.6.7", + "version": "0.7.0", "description": "Zero magic, fast test-runner and assertion framework. No magic globals.", "main": "index.js", "repository": { @@ -23,9 +23,9 @@ "dependencies": { "@codefeathers/iseq": "^1.2.1", "@codefeathers/promise.object": "^0.9.5", - "bluebird": "^3.5.1", - "chalk": "^2.4.1", - "eslint": "^5.2.0", "json-stringify-safe": "^5.0.1" + }, + "devDependencies": { + "eslint": "^5.2.0" } } diff --git a/shrinkwrap.yaml b/shrinkwrap.yaml index 5d831af..44fa457 100644 --- a/shrinkwrap.yaml +++ b/shrinkwrap.yaml @@ -1,10 +1,9 @@ dependencies: '@codefeathers/iseq': 1.2.1 '@codefeathers/promise.object': 0.9.5 - bluebird: 3.5.1 - chalk: 2.4.1 - eslint: 5.2.0 json-stringify-safe: 5.0.1 +devDependencies: + eslint: 5.2.0 packages: /@codefeathers/iseq/1.2.1: dev: false @@ -17,11 +16,11 @@ packages: /acorn-jsx/4.1.1: dependencies: acorn: 5.7.1 - dev: false + dev: true resolution: integrity: sha512-JY+iV6r+cO21KtntVvFkD+iqjtdpRUpGqKWgfkCdZq1R+kbreEl8EcdcJR4SmiIgsIQT33s6QzheQ9a275Q8xw== /acorn/5.7.1: - dev: false + dev: true engines: node: '>=0.4.0' hasBin: true @@ -30,7 +29,7 @@ packages: /ajv-keywords/3.2.0/ajv@6.5.2: dependencies: ajv: 6.5.2 - dev: false + dev: true id: registry.npmjs.org/ajv-keywords/3.2.0 peerDependencies: ajv: ^6.0.0 @@ -42,29 +41,29 @@ packages: fast-json-stable-stringify: 2.0.0 json-schema-traverse: 0.4.1 uri-js: 4.2.2 - dev: false + dev: true resolution: integrity: sha512-hOs7GfvI6tUI1LfZddH82ky6mOMyTuY0mk7kE2pWpmhhUSkumzaTO5vbVwij39MdwPQWCV4Zv57Eo06NtL/GVA== /ansi-escapes/3.1.0: - dev: false + dev: true engines: node: '>=4' resolution: integrity: sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw== /ansi-regex/2.1.1: - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-w7M6te42DYbg5ijwRorn7yfWVN8= /ansi-regex/3.0.0: - dev: false + dev: true engines: node: '>=4' resolution: integrity: sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= /ansi-styles/2.2.1: - dev: false + dev: true engines: node: '>=0.10.0' resolution: @@ -72,7 +71,7 @@ packages: /ansi-styles/3.2.1: dependencies: color-convert: 1.9.2 - dev: false + dev: true engines: node: '>=4' resolution: @@ -80,25 +79,25 @@ packages: /argparse/1.0.10: dependencies: sprintf-js: 1.0.3 - dev: false + dev: true resolution: integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== /array-union/1.0.2: dependencies: array-uniq: 1.0.3 - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= /array-uniq/1.0.3: - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= /arrify/1.0.1: - dev: false + dev: true engines: node: '>=0.10.0' resolution: @@ -108,34 +107,30 @@ packages: chalk: 1.1.3 esutils: 2.0.2 js-tokens: 3.0.2 - dev: false + dev: true resolution: integrity: sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= /balanced-match/1.0.0: - dev: false + dev: true resolution: integrity: sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - /bluebird/3.5.1: - dev: false - resolution: - integrity: sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA== /brace-expansion/1.1.11: dependencies: balanced-match: 1.0.0 concat-map: 0.0.1 - dev: false + dev: true resolution: integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== /caller-path/0.1.0: dependencies: callsites: 0.2.0 - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8= /callsites/0.2.0: - dev: false + dev: true engines: node: '>=0.10.0' resolution: @@ -147,7 +142,7 @@ packages: has-ansi: 2.0.0 strip-ansi: 3.0.1 supports-color: 2.0.0 - dev: false + dev: true engines: node: '>=0.10.0' resolution: @@ -157,43 +152,43 @@ packages: ansi-styles: 3.2.1 escape-string-regexp: 1.0.5 supports-color: 5.4.0 - dev: false + dev: true engines: node: '>=4' resolution: integrity: sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== /chardet/0.4.2: - dev: false + dev: true resolution: integrity: sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I= /circular-json/0.3.3: - dev: false + dev: true resolution: integrity: sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A== /cli-cursor/2.1.0: dependencies: restore-cursor: 2.0.0 - dev: false + dev: true engines: node: '>=4' resolution: integrity: sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= /cli-width/2.2.0: - dev: false + dev: true resolution: integrity: sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= /color-convert/1.9.2: dependencies: color-name: 1.1.1 - dev: false + dev: true resolution: integrity: sha512-3NUJZdhMhcdPn8vJ9v2UQJoH0qqoGUkYTgFEPZaPjEtwmmKUfNV46zZmgB2M5M4DCEQHMaCfWHCxiBflLm04Tg== /color-name/1.1.1: - dev: false + dev: true resolution: integrity: sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok= /concat-map/0.0.1: - dev: false + dev: true resolution: integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= /cross-spawn/6.0.5: @@ -203,7 +198,7 @@ packages: semver: 5.5.0 shebang-command: 1.2.0 which: 1.3.1 - dev: false + dev: true engines: node: '>=4.8' resolution: @@ -211,18 +206,18 @@ packages: /debug/3.1.0: dependencies: ms: 2.0.0 - dev: false + dev: true resolution: integrity: sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== /deep-is/0.1.3: - dev: false + dev: true resolution: integrity: sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= /define-properties/1.1.2: dependencies: foreach: 2.0.5 object-keys: 1.0.12 - dev: false + dev: true engines: node: '>= 0.4' resolution: @@ -236,7 +231,7 @@ packages: pify: 2.3.0 pinkie-promise: 2.0.1 rimraf: 2.6.2 - dev: false + dev: true engines: node: '>=0.10.0' resolution: @@ -244,7 +239,7 @@ packages: /doctrine/2.1.0: dependencies: esutils: 2.0.2 - dev: false + dev: true engines: node: '>=0.10.0' resolution: @@ -256,7 +251,7 @@ packages: has: 1.0.3 is-callable: 1.1.4 is-regex: 1.0.4 - dev: false + dev: true engines: node: '>= 0.4' resolution: @@ -266,13 +261,13 @@ packages: is-callable: 1.1.4 is-date-object: 1.0.1 is-symbol: 1.0.1 - dev: false + dev: true engines: node: '>= 0.4' resolution: integrity: sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0= /escape-string-regexp/1.0.5: - dev: false + dev: true engines: node: '>=0.8.0' resolution: @@ -281,19 +276,19 @@ packages: dependencies: esrecurse: 4.2.1 estraverse: 4.2.0 - dev: false + dev: true engines: node: '>=4.0.0' resolution: integrity: sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA== /eslint-utils/1.3.1: - dev: false + dev: true engines: node: '>=6' resolution: integrity: sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q== /eslint-visitor-keys/1.0.0: - dev: false + dev: true engines: node: '>=4' resolution: @@ -339,7 +334,7 @@ packages: strip-json-comments: 2.0.1 table: 4.0.3 text-table: 0.2.0 - dev: false + dev: true engines: node: ^6.14.0 || ^8.10.0 || >=9.10.0 hasBin: true @@ -349,13 +344,13 @@ packages: dependencies: acorn: 5.7.1 acorn-jsx: 4.1.1 - dev: false + dev: true engines: node: '>=6.0.0' resolution: integrity: sha512-kapdTCt1bjmspxStVKX6huolXVV5ZfyZguY1lcfhVVZstce3bqxH9mcLzNn3/mlgW6wQ732+0fuG9v7h0ZQoKg== /esprima/4.0.1: - dev: false + dev: true engines: node: '>=4' hasBin: true @@ -364,7 +359,7 @@ packages: /esquery/1.0.1: dependencies: estraverse: 4.2.0 - dev: false + dev: true engines: node: '>=0.6' resolution: @@ -372,19 +367,19 @@ packages: /esrecurse/4.2.1: dependencies: estraverse: 4.2.0 - dev: false + dev: true engines: node: '>=4.0' resolution: integrity: sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== /estraverse/4.2.0: - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= /esutils/2.0.2: - dev: false + dev: true engines: node: '>=0.10.0' resolution: @@ -394,27 +389,27 @@ packages: chardet: 0.4.2 iconv-lite: 0.4.23 tmp: 0.0.33 - dev: false + dev: true engines: node: '>=0.12' resolution: integrity: sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A== /fast-deep-equal/2.0.1: - dev: false + dev: true resolution: integrity: sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= /fast-json-stable-stringify/2.0.0: - dev: false + dev: true resolution: integrity: sha1-1RQsDK7msRifh9OnYREGT4bIu/I= /fast-levenshtein/2.0.6: - dev: false + dev: true resolution: integrity: sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= /figures/2.0.0: dependencies: escape-string-regexp: 1.0.5 - dev: false + dev: true engines: node: '>=4' resolution: @@ -423,7 +418,7 @@ packages: dependencies: flat-cache: 1.3.0 object-assign: 4.1.1 - dev: false + dev: true engines: node: '>=0.10.0' resolution: @@ -434,25 +429,25 @@ packages: del: 2.2.2 graceful-fs: 4.1.11 write: 0.2.1 - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE= /foreach/2.0.5: - dev: false + dev: true resolution: integrity: sha1-C+4AUBiusmDQo6865ljdATbsG5k= /fs.realpath/1.0.0: - dev: false + dev: true resolution: integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8= /function-bind/1.1.1: - dev: false + dev: true resolution: integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== /functional-red-black-tree/1.0.1: - dev: false + dev: true resolution: integrity: sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= /glob/7.1.2: @@ -463,11 +458,11 @@ packages: minimatch: 3.0.4 once: 1.4.0 path-is-absolute: 1.0.1 - dev: false + dev: true resolution: integrity: sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== /globals/11.7.0: - dev: false + dev: true engines: node: '>=4' resolution: @@ -480,13 +475,13 @@ packages: object-assign: 4.1.1 pify: 2.3.0 pinkie-promise: 2.0.1 - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0= /graceful-fs/4.1.11: - dev: false + dev: true engines: node: '>=0.4.0' resolution: @@ -494,19 +489,19 @@ packages: /has-ansi/2.0.0: dependencies: ansi-regex: 2.1.1 - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= /has-flag/3.0.0: - dev: false + dev: true engines: node: '>=4' resolution: integrity: sha1-tdRU3CGZriJWmfNGfloH87lVuv0= /has-symbols/1.0.0: - dev: false + dev: true engines: node: '>= 0.4' resolution: @@ -514,7 +509,7 @@ packages: /has/1.0.3: dependencies: function-bind: 1.1.1 - dev: false + dev: true engines: node: '>= 0.4.0' resolution: @@ -522,19 +517,19 @@ packages: /iconv-lite/0.4.23: dependencies: safer-buffer: 2.1.2 - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA== /ignore/4.0.3: - dev: false + dev: true engines: node: '>= 4' resolution: integrity: sha512-Z/vAH2GGIEATQnBVXMclE2IGV6i0GyVngKThcGZ5kHgHMxLo9Ow2+XHRq1aEKEej5vOF1TPJNbvX6J/anT0M7A== /imurmurhash/0.1.4: - dev: false + dev: true engines: node: '>=0.8.19' resolution: @@ -543,11 +538,11 @@ packages: dependencies: once: 1.4.0 wrappy: 1.0.2 - dev: false + dev: true resolution: integrity: sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= /inherits/2.0.3: - dev: false + dev: true resolution: integrity: sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= /inquirer/5.2.0: @@ -565,31 +560,31 @@ packages: string-width: 2.1.1 strip-ansi: 4.0.0 through: 2.3.8 - dev: false + dev: true engines: node: '>=6.0.0' resolution: integrity: sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ== /is-callable/1.1.4: - dev: false + dev: true engines: node: '>= 0.4' resolution: integrity: sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== /is-date-object/1.0.1: - dev: false + dev: true engines: node: '>= 0.4' resolution: integrity: sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= /is-fullwidth-code-point/2.0.0: - dev: false + dev: true engines: node: '>=4' resolution: integrity: sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= /is-path-cwd/1.0.0: - dev: false + dev: true engines: node: '>=0.10.0' resolution: @@ -597,7 +592,7 @@ packages: /is-path-in-cwd/1.0.1: dependencies: is-path-inside: 1.0.1 - dev: false + dev: true engines: node: '>=0.10.0' resolution: @@ -605,55 +600,55 @@ packages: /is-path-inside/1.0.1: dependencies: path-is-inside: 1.0.2 - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-jvW33lBDej/cprToZe96pVy0gDY= /is-promise/2.1.0: - dev: false + dev: true resolution: integrity: sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= /is-regex/1.0.4: dependencies: has: 1.0.3 - dev: false + dev: true engines: node: '>= 0.4' resolution: integrity: sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= /is-resolvable/1.1.0: - dev: false + dev: true resolution: integrity: sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg== /is-symbol/1.0.1: - dev: false + dev: true engines: node: '>= 0.4' resolution: integrity: sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI= /isexe/2.0.0: - dev: false + dev: true resolution: integrity: sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= /js-tokens/3.0.2: - dev: false + dev: true resolution: integrity: sha1-mGbfOVECEw449/mWvOtlRDIJwls= /js-yaml/3.12.0: dependencies: argparse: 1.0.10 esprima: 4.0.1 - dev: false + dev: true hasBin: true resolution: integrity: sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A== /json-schema-traverse/0.4.1: - dev: false + dev: true resolution: integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== /json-stable-stringify-without-jsonify/1.0.1: - dev: false + dev: true resolution: integrity: sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= /json-stringify-safe/5.0.1: @@ -664,17 +659,17 @@ packages: dependencies: prelude-ls: 1.1.2 type-check: 0.3.2 - dev: false + dev: true engines: node: '>= 0.8.0' resolution: integrity: sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= /lodash/4.17.10: - dev: false + dev: true resolution: integrity: sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg== /mimic-fn/1.2.0: - dev: false + dev: true engines: node: '>=4' resolution: @@ -682,44 +677,44 @@ packages: /minimatch/3.0.4: dependencies: brace-expansion: 1.1.11 - dev: false + dev: true resolution: integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== /minimist/0.0.8: - dev: false + dev: true resolution: integrity: sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= /mkdirp/0.5.1: dependencies: minimist: 0.0.8 - dev: false + dev: true hasBin: true resolution: integrity: sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= /ms/2.0.0: - dev: false + dev: true resolution: integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= /mute-stream/0.0.7: - dev: false + dev: true resolution: integrity: sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= /natural-compare/1.4.0: - dev: false + dev: true resolution: integrity: sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= /nice-try/1.0.4: - dev: false + dev: true resolution: integrity: sha512-2NpiFHqC87y/zFke0fC0spBXL3bBsoh/p5H1EFhshxjCR5+0g2d6BiXbUFz9v1sAcxsk2htp2eQnNIci2dIYcA== /object-assign/4.1.1: - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= /object-keys/1.0.12: - dev: false + dev: true engines: node: '>= 0.4' resolution: @@ -727,13 +722,13 @@ packages: /once/1.4.0: dependencies: wrappy: 1.0.2 - dev: false + dev: true resolution: integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E= /onetime/2.0.1: dependencies: mimic-fn: 1.2.0 - dev: false + dev: true engines: node: '>=4' resolution: @@ -746,35 +741,35 @@ packages: prelude-ls: 1.1.2 type-check: 0.3.2 wordwrap: 1.0.0 - dev: false + dev: true engines: node: '>= 0.8.0' resolution: integrity: sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= /os-tmpdir/1.0.2: - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= /path-is-absolute/1.0.1: - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-F0uSaHNVNP+8es5r9TpanhtcX18= /path-is-inside/1.0.2: - dev: false + dev: true resolution: integrity: sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= /path-key/2.0.1: - dev: false + dev: true engines: node: '>=4' resolution: integrity: sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= /pify/2.3.0: - dev: false + dev: true engines: node: '>=0.10.0' resolution: @@ -782,37 +777,37 @@ packages: /pinkie-promise/2.0.1: dependencies: pinkie: 2.0.4 - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-ITXW36ejWMBprJsXh3YogihFD/o= /pinkie/2.0.4: - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-clVrgM+g1IqXToDnckjoDtT3+HA= /pluralize/7.0.0: - dev: false + dev: true engines: node: '>=4' resolution: integrity: sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== /prelude-ls/1.1.2: - dev: false + dev: true engines: node: '>= 0.8.0' resolution: integrity: sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= /progress/2.0.0: - dev: false + dev: true engines: node: '>=0.4.0' resolution: integrity: sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8= /punycode/2.1.1: - dev: false + dev: true engines: node: '>=6' resolution: @@ -820,13 +815,13 @@ packages: /regexp.prototype.flags/1.2.0: dependencies: define-properties: 1.1.2 - dev: false + dev: true engines: node: '>= 0.4' resolution: integrity: sha512-ztaw4M1VqgMwl9HlPpOuiYgItcHlunW0He2fE6eNfT6E/CF2FtYi9ofOYe4mKntstYk0Fyh/rDRBdS3AnxjlrA== /regexpp/1.1.0: - dev: false + dev: true engines: node: '>=4.0.0' resolution: @@ -835,13 +830,13 @@ packages: dependencies: caller-path: 0.1.0 resolve-from: 1.0.1 - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM= /resolve-from/1.0.1: - dev: false + dev: true engines: node: '>=0.10.0' resolution: @@ -850,7 +845,7 @@ packages: dependencies: onetime: 2.0.1 signal-exit: 3.0.2 - dev: false + dev: true engines: node: '>=4' resolution: @@ -858,14 +853,14 @@ packages: /rimraf/2.6.2: dependencies: glob: 7.1.2 - dev: false + dev: true hasBin: true resolution: integrity: sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w== /run-async/2.3.0: dependencies: is-promise: 2.1.0 - dev: false + dev: true engines: node: '>=0.12.0' resolution: @@ -873,55 +868,55 @@ packages: /rxjs/5.5.11: dependencies: symbol-observable: 1.0.1 - dev: false + dev: true engines: npm: '>=2.0.0' resolution: integrity: sha512-3bjO7UwWfA2CV7lmwYMBzj4fQ6Cq+ftHc2MvUe+WMS7wcdJ1LosDWmdjPQanYp2dBRj572p7PeU81JUxHKOcBA== /safer-buffer/2.1.2: - dev: false + dev: true resolution: integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== /semver/5.5.0: - dev: false + dev: true hasBin: true resolution: integrity: sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== /shebang-command/1.2.0: dependencies: shebang-regex: 1.0.0 - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= /shebang-regex/1.0.0: - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= /signal-exit/3.0.2: - dev: false + dev: true resolution: integrity: sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= /slice-ansi/1.0.0: dependencies: is-fullwidth-code-point: 2.0.0 - dev: false + dev: true engines: node: '>=4' resolution: integrity: sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg== /sprintf-js/1.0.3: - dev: false + dev: true resolution: integrity: sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= /string-width/2.1.1: dependencies: is-fullwidth-code-point: 2.0.0 strip-ansi: 4.0.0 - dev: false + dev: true engines: node: '>=4' resolution: @@ -933,13 +928,13 @@ packages: function-bind: 1.1.1 has-symbols: 1.0.0 regexp.prototype.flags: 1.2.0 - dev: false + dev: true resolution: integrity: sha512-WoZ+B2ypng1dp4iFLF2kmZlwwlE19gmjgKuhL1FJfDgCREWb3ye3SDVHSzLH6bxfnvYmkCxbzkmWcQZHA4P//Q== /strip-ansi/3.0.1: dependencies: ansi-regex: 2.1.1 - dev: false + dev: true engines: node: '>=0.10.0' resolution: @@ -947,19 +942,19 @@ packages: /strip-ansi/4.0.0: dependencies: ansi-regex: 3.0.0 - dev: false + dev: true engines: node: '>=4' resolution: integrity: sha1-qEeQIusaw2iocTibY1JixQXuNo8= /strip-json-comments/2.0.1: - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-PFMZQukIwml8DsNEhYwobHygpgo= /supports-color/2.0.0: - dev: false + dev: true engines: node: '>=0.8.0' resolution: @@ -967,13 +962,13 @@ packages: /supports-color/5.4.0: dependencies: has-flag: 3.0.0 - dev: false + dev: true engines: node: '>=4' resolution: integrity: sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w== /symbol-observable/1.0.1: - dev: false + dev: true engines: node: '>=0.10.0' resolution: @@ -986,23 +981,23 @@ packages: lodash: 4.17.10 slice-ansi: 1.0.0 string-width: 2.1.1 - dev: false + dev: true engines: node: '>=4.0.0' resolution: integrity: sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg== /text-table/0.2.0: - dev: false + dev: true resolution: integrity: sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= /through/2.3.8: - dev: false + dev: true resolution: integrity: sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= /tmp/0.0.33: dependencies: os-tmpdir: 1.0.2 - dev: false + dev: true engines: node: '>=0.6.0' resolution: @@ -1010,7 +1005,7 @@ packages: /type-check/0.3.2: dependencies: prelude-ls: 1.1.2 - dev: false + dev: true engines: node: '>= 0.8.0' resolution: @@ -1018,39 +1013,37 @@ packages: /uri-js/4.2.2: dependencies: punycode: 2.1.1 - dev: false + dev: true resolution: integrity: sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== /which/1.3.1: dependencies: isexe: 2.0.0 - dev: false + dev: true hasBin: true resolution: integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== /wordwrap/1.0.0: - dev: false + dev: true resolution: integrity: sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= /wrappy/1.0.2: - dev: false + dev: true resolution: integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= /write/0.2.1: dependencies: mkdirp: 0.5.1 - dev: false + dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c= registry: 'https://registry.npmjs.org/' -shrinkwrapMinorVersion: 8 +shrinkwrapMinorVersion: 9 shrinkwrapVersion: 3 specifiers: '@codefeathers/iseq': ^1.2.1 '@codefeathers/promise.object': ^0.9.5 - bluebird: ^3.5.1 - chalk: ^2.4.1 eslint: ^5.2.0 json-stringify-safe: ^5.0.1 diff --git a/src/gunner.js b/src/gunner.js index 0a7c2f9..968f410 100644 --- a/src/gunner.js +++ b/src/gunner.js @@ -1,126 +1,96 @@ 'use strict'; -const { EOL } = require('os'); -const chalk = require('chalk'); +const { arrayOrPush } = require('./util'); +const caller = require('./lib/unit/caller'); -const Promise = require('bluebird'); -Promise.object = require('@codefeathers/promise.object'); - -const _runTests = require('./lib/runTests'); -const _expect = require('./lib/expect'); -const logger = require('./lib/logger'); +const testrunner = require('./lib/testrunner'); +const { expect, expectMany } = require('./lib/expect'); const symbols = require('./util/symbols'); class Gunner { - constructor (options = {}) { - this.__hooks__ = { - before: { + constructor (name) { + this.name = name; + this.__suite__ = { + tests: [], + beforeHooks: { [symbols.Start]: [], [symbols.End]: [], '*': [], }, - after: { + afterHooks: { [symbols.Start]: [], [symbols.End]: [], '*': [], - }, + } }; - this.__state__ = []; - this.__tests__ = []; - this.name = options.name; } test (description, test) { const existing = ( - this.__tests__ + this.__suite__.tests .find(x => x.description === description) ); if (existing) throw new Error(`Test '${description}' already exists!`); - this.__tests__.push({ + const unit = { description, - test: state => { - try { - return test(_expect, state); - } catch (e) { - // If errors are thrown, reject them - return Promise.reject(e); - } - }, - }); - + type: 'test', + run: state => caller(test, state), + }; + this.__suite__.tests.push(unit); return this; } - before (description, run) { - const hook = { + before (description, run, label) { + const unit = { description, - run, + label, + type: 'hook', + run: state => caller(run, state), }; - - this.__hooks__.before[description] - ? this.__hooks__.before[description].push(hook) - : this.__hooks__.before[description] = [ hook ]; - + arrayOrPush(this.__suite__.beforeHooks, description, unit); return this; } - after (description, run) { - const hook = { + after (description, run, label) { + const unit = { description, - run, + label, + type: 'hook', + run: state => caller(run, state), }; - - this.__hooks__.after[description] - ? this.__hooks__.after[description].push(hook) - : this.__hooks__.after[description] = [ hook ]; - + arrayOrPush(this.__suite__.afterHooks, description, unit); return this; } run (options = {}) { - return _runTests(this, options) - .then(results => { - const success = results.filter(r => r.result === 'pass'); - const successPercent = Math.floor( - success.length/results.length * 100 - ); - - const beforeAfterLine = - successPercent === 100 - ? chalk`{green ------------------------------------}` - : chalk`{red ------------------------------------}`; - - const log = logger.create(options); - log( - EOL, - beforeAfterLine, - EOL, EOL, - chalk`{green ${success.length}}`, - `tests passed of ${results.length}`, - `[${successPercent}% success]`, - EOL, EOL, - beforeAfterLine - ); - - if((successPercent !== 100) && typeof process !== 'undefined') - process.exitCode = 1; - - return results; - }) - .then(results => { - if (options.exit && typeof process !== 'undefined') - process.exit(); - return results; - }); + return testrunner(this, options); + // .then(results => { + // const success = results.filter(r => r.result === 'pass'); + // const successPercent = Math.floor( + // success.length/results.length * 100 + // ); + + // if((successPercent !== 100) && typeof process !== 'undefined') + // process.exitCode = 1; + + // return results; + // }) + // .then(results => { + // if (options.exit && typeof process !== 'undefined') + // process.exit(); + // return results; + // }); } } module.exports = Gunner; -module.exports.expect = _expect; +module.exports.Gunner = Gunner; +module.exports.expect = expect; +module.exports.expectMany = expectMany; module.exports.Start = symbols.Start; module.exports.End = symbols.End;