From 5aaccaa66de0478cdf703b58196d60ed40d7e53d Mon Sep 17 00:00:00 2001 From: Michael Goin Date: Thu, 3 Jun 2021 14:34:56 -0700 Subject: [PATCH 01/13] Bumps tap ^15.0.9. --- package-lock.json | 2114 ++++++++++++++++++++++++++------------------- package.json | 2 +- 2 files changed, 1231 insertions(+), 885 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1148a63baf..4fc76108fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,60 +13,225 @@ "@babel/highlight": "^7.0.0" } }, + "@babel/compat-data": { + "version": "7.14.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.4.tgz", + "integrity": "sha512-i2wXrWQNkH6JplJQGn3Rd2I4Pij8GdHkXwHMxm+zV5YG/Jci+bCNrWZEWC4o+umiDkRrRs4dVzH3X4GP7vyjQQ==", + "dev": true + }, + "@babel/core": { + "version": "7.14.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.3.tgz", + "integrity": "sha512-jB5AmTKOCSJIZ72sd78ECEhuPiDMKlQdDI/4QRI6lzYATx5SSogS1oQA2AoPecRCknm30gHi2l+QVvNUu3wZAg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.3", + "@babel/helper-compilation-targets": "^7.13.16", + "@babel/helper-module-transforms": "^7.14.2", + "@babel/helpers": "^7.14.0", + "@babel/parser": "^7.14.3", + "@babel/template": "^7.12.13", + "@babel/traverse": "^7.14.2", + "@babel/types": "^7.14.2", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.1.2", + "semver": "^6.3.0", + "source-map": "^0.5.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.12.13" + } + }, + "@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.14.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.4.tgz", + "integrity": "sha512-ArliyUsWDUqEGfWcmzpGUzNfLxTdTp6WU4IuP6QFSp9gGfWS6boxFCkJSJ/L4+RG8z/FnIU3WxCk6hPL9SSWeA==", + "dev": true + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, "@babel/generator": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.5.tgz", - "integrity": "sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==", + "version": "7.14.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.3.tgz", + "integrity": "sha512-bn0S6flG/j0xtQdz3hsjJ624h3W0r3llttBMfyHX3YrZ/KtLYr15bjA0FXkgW7FpvrDuTuElXeVjiKlYRpnOFA==", "dev": true, "requires": { - "@babel/types": "^7.12.5", + "@babel/types": "^7.14.2", "jsesc": "^2.5.1", "source-map": "^0.5.0" + } + }, + "@babel/helper-compilation-targets": { + "version": "7.14.4", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.14.4.tgz", + "integrity": "sha512-JgdzOYZ/qGaKTVkn5qEDV/SXAh8KcyUVkCoSWGN8T3bwrgd6m+/dJa2kVGi6RJYJgEYPBdZ84BZp9dUjNWkBaA==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.14.4", + "@babel/helper-validator-option": "^7.12.17", + "browserslist": "^4.16.6", + "semver": "^6.3.0" }, "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } }, "@babel/helper-function-name": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", - "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.2.tgz", + "integrity": "sha512-NYZlkZRydxw+YT56IlhIcS8PAhb+FEUiOzuhFTfqDyPmzAhRge6ua0dQYT/Uh0t/EDHq05/i+e5M2d4XvjgarQ==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.10.4", - "@babel/template": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.14.2" } }, "@babel/helper-get-function-arity": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", - "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-module-imports": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", + "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-module-transforms": { + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.2.tgz", + "integrity": "sha512-OznJUda/soKXv0XhpvzGWDnml4Qnwp16GN+D/kZIdLsWoHj05kyu8Rm5kXmMef+rVJZ0+4pSGLkeixdqNUATDA==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.13.12", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-simple-access": "^7.13.12", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/helper-validator-identifier": "^7.14.0", + "@babel/template": "^7.12.13", + "@babel/traverse": "^7.14.2", + "@babel/types": "^7.14.2" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", + "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-replace-supers": { + "version": "7.14.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.14.4.tgz", + "integrity": "sha512-zZ7uHCWlxfEAAOVDYQpEf/uyi1dmeC7fX4nCf2iz9drnCwi1zvwXL3HwWWNXUQEJ1k23yVn3VbddiI9iJEXaTQ==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/traverse": "^7.14.2", + "@babel/types": "^7.14.4" + } + }, + "@babel/helper-simple-access": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", + "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", "dev": true, "requires": { - "@babel/types": "^7.10.4" + "@babel/types": "^7.13.12" } }, "@babel/helper-split-export-declaration": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", - "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==", + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", "dev": true, "requires": { - "@babel/types": "^7.11.0" + "@babel/types": "^7.12.13" } }, "@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.12.17", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz", + "integrity": "sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw==", "dev": true }, + "@babel/helpers": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.0.tgz", + "integrity": "sha512-+ufuXprtQ1D1iZTO/K9+EBRn+qPWMJjZSw/S0KlFrxCw4tkrzv9grgpDHkY9MeQTjTY8i2sp7Jep8DfU6tN9Mg==", + "dev": true, + "requires": { + "@babel/template": "^7.12.13", + "@babel/traverse": "^7.14.0", + "@babel/types": "^7.14.0" + } + }, "@babel/highlight": { "version": "7.5.0", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", @@ -116,91 +281,90 @@ "dev": true }, "@babel/template": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", - "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", "dev": true, "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/parser": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" }, "dependencies": { "@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", "dev": true, "requires": { - "@babel/highlight": "^7.10.4" + "@babel/highlight": "^7.12.13" } }, "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.10.4", + "@babel/helper-validator-identifier": "^7.14.0", "chalk": "^2.0.0", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.5.tgz", - "integrity": "sha512-FVM6RZQ0mn2KCf1VUED7KepYeUWoVShczewOCfm3nzoBybaih51h+sYVVGthW9M6lPByEPTQf+xm27PBdlpwmQ==", + "version": "7.14.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.4.tgz", + "integrity": "sha512-ArliyUsWDUqEGfWcmzpGUzNfLxTdTp6WU4IuP6QFSp9gGfWS6boxFCkJSJ/L4+RG8z/FnIU3WxCk6hPL9SSWeA==", "dev": true } } }, "@babel/traverse": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.5.tgz", - "integrity": "sha512-xa15FbQnias7z9a62LwYAA5SZZPkHIXpd42C6uW68o8uTuua96FHZy1y61Va5P/i83FAAcMpW8+A/QayntzuqA==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.2.tgz", + "integrity": "sha512-TsdRgvBFHMyHOOzcP9S6QU0QQtjxlRpEYOy3mcCO5RgmC305ki42aSAmfZEMSSYBla2oZ9BMqYlncBaKmD/7iA==", "dev": true, "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.12.5", - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.12.5", - "@babel/types": "^7.12.5", + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.2", + "@babel/helper-function-name": "^7.14.2", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.2", + "@babel/types": "^7.14.2", "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.19" + "globals": "^11.1.0" }, "dependencies": { "@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", "dev": true, "requires": { - "@babel/highlight": "^7.10.4" + "@babel/highlight": "^7.12.13" } }, "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.10.4", + "@babel/helper-validator-identifier": "^7.14.0", "chalk": "^2.0.0", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.5.tgz", - "integrity": "sha512-FVM6RZQ0mn2KCf1VUED7KepYeUWoVShczewOCfm3nzoBybaih51h+sYVVGthW9M6lPByEPTQf+xm27PBdlpwmQ==", + "version": "7.14.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.4.tgz", + "integrity": "sha512-ArliyUsWDUqEGfWcmzpGUzNfLxTdTp6WU4IuP6QFSp9gGfWS6boxFCkJSJ/L4+RG8z/FnIU3WxCk6hPL9SSWeA==", "dev": true }, "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "dev": true, "requires": { "ms": "2.1.2" @@ -209,13 +373,12 @@ } }, "@babel/types": { - "version": "7.12.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.6.tgz", - "integrity": "sha512-hwyjw6GvjBLiyy3W0YQf0Z5Zf4NpYejUnKFcfcUhZCSffoBBp30w6wP2Wn6pk31jMYZvcOrB/1b7cGXvEoKogA==", + "version": "7.14.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.4.tgz", + "integrity": "sha512-lCj4aIs0xUefJFQnwwQv2Bxg7Omd6bgquZ6LGC+gGMh6/s5qDVfjuCMlDmYQ15SLsWHd9n+X3E75lKIhl5Lkiw==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "lodash": "^4.17.19", + "@babel/helper-validator-identifier": "^7.14.0", "to-fast-properties": "^2.0.0" } }, @@ -245,6 +408,39 @@ "protobufjs": "^6.8.6" } }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } + } + }, + "@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true + }, "@netflix/nerror": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@netflix/nerror/-/nerror-1.1.2.tgz", @@ -746,9 +942,9 @@ } }, "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "dev": true, "requires": { "normalize-path": "^3.0.0", @@ -756,12 +952,12 @@ } }, "append-transform": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz", - "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", "dev": true, "requires": { - "default-require-extensions": "^2.0.0" + "default-require-extensions": "^3.0.0" } }, "architect": { @@ -776,12 +972,6 @@ "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", "dev": true }, - "arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -853,13 +1043,10 @@ "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==" }, "async-hook-domain": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/async-hook-domain/-/async-hook-domain-1.1.3.tgz", - "integrity": "sha512-ZovMxSbADV3+biB7oR1GL5lGyptI24alp0LWHlmz1OFc5oL47pz3EiIF6nXOkDW7yLqih4NtsiYduzdDW0i+Wg==", - "dev": true, - "requires": { - "source-map-support": "^0.5.11" - } + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/async-hook-domain/-/async-hook-domain-2.0.3.tgz", + "integrity": "sha512-MadiLLDEZRZzZwcm0dgS+K99qXZ4H2saAUwUgwzFulbAkXrKi3AX5FvWS3FFTQtLMwrqcGqAJe6o12KrObejQA==", + "dev": true }, "asynckit": { "version": "0.4.0", @@ -956,15 +1143,15 @@ "dev": true }, "binary-extensions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, "bind-obj-methods": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/bind-obj-methods/-/bind-obj-methods-2.0.0.tgz", - "integrity": "sha512-3/qRXczDi2Cdbz6jE+W3IflJOutRVica8frpBn14de1mBOkzDo+6tY33kNhvkw54Kn3PzRRD2VnGbGPcTAk4sw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bind-obj-methods/-/bind-obj-methods-3.0.0.tgz", + "integrity": "sha512-nLEaaz3/sEzNSyPWRsN9HNsqwk1AUyECtGj+XwGdIi3xABnEqecvXtIJ0wehQXuuER5uZ/5fTs2usONgYjG+iw==", "dev": true }, "bluebird": { @@ -1046,11 +1233,18 @@ "fill-range": "^7.0.1" } }, - "browser-process-hrtime": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", - "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", - "dev": true + "browserslist": { + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" + } }, "bson": { "version": "1.1.3", @@ -1110,28 +1304,15 @@ } }, "caching-transform": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-3.0.2.tgz", - "integrity": "sha512-Mtgcv3lh3U0zRii/6qVgQODdPA4G3zhG+jtbCWj39RXuUFTMzH0vcdMtaJS1jPowd+It2Pqr6y3NJMQqOqCE2w==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", "dev": true, "requires": { - "hasha": "^3.0.0", - "make-dir": "^2.0.0", - "package-hash": "^3.0.0", - "write-file-atomic": "^2.4.2" - }, - "dependencies": { - "write-file-atomic": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", - "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } - } + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" } }, "callsites": { @@ -1146,6 +1327,12 @@ "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", "dev": true }, + "caniuse-lite": { + "version": "1.0.30001233", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001233.tgz", + "integrity": "sha512-BmkbxLfStqiPA7IEzQpIk0UFZFf3A4E6fzjPJ6OR+bFC2L8ES9J8zGA/asoi47p8XDVkev+WJo2I2Nc8c/34Yg==", + "dev": true + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -1199,14 +1386,14 @@ "dev": true }, "chokidar": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", - "integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", + "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", "dev": true, "requires": { "anymatch": "~3.1.1", "braces": "~3.0.2", - "fsevents": "~2.1.2", + "fsevents": "~2.3.1", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", @@ -1379,6 +1566,12 @@ "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", "dev": true }, + "colorette": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", + "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", + "dev": true + }, "colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", @@ -1579,27 +1772,6 @@ } } }, - "cp-file": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-6.2.0.tgz", - "integrity": "sha512-fmvV4caBnofhPe8kOcitBwSn2f39QLjnAnGq3gO9dfd75mUytzKNZB1hde6QHunW2Rt+OwuBOMc3i1tNElbszA==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "make-dir": "^2.0.0", - "nested-error-stacks": "^2.0.0", - "pify": "^4.0.1", - "safe-buffer": "^5.0.1" - }, - "dependencies": { - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - } - } - }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -1713,12 +1885,12 @@ "dev": true }, "default-require-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", - "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", + "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", "dev": true, "requires": { - "strip-bom": "^3.0.0" + "strip-bom": "^4.0.0" } }, "defaults": { @@ -1766,12 +1938,6 @@ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, - "diff-frag": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/diff-frag/-/diff-frag-1.0.1.tgz", - "integrity": "sha512-6/v2PC/6UTGcWPPetb9acL8foberUg/CtPdALeJUdD1B/weHNvzftoo00gYznqHGRhHEbykUGzqfG9RWOSr5yw==", - "dev": true - }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -1821,6 +1987,12 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", "dev": true }, + "electron-to-chromium": { + "version": "1.3.746", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.746.tgz", + "integrity": "sha512-3ffyGODL38apwSsIgXaWnAKNXChsjXhAmBTjbqCbrv1fBbVltuNLWh0zdrQbwK/oxPQ/Gss/kYfFAPPGu9mszQ==", + "dev": true + }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", @@ -1863,6 +2035,12 @@ "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -2021,12 +2199,6 @@ "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", "dev": true }, - "esm": { - "version": "3.2.25", - "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", - "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", - "dev": true - }, "espree": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.0.tgz", @@ -2496,14 +2668,14 @@ } }, "find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", "dev": true, "requires": { "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" } }, "find-my-way": { @@ -2518,12 +2690,13 @@ } }, "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "requires": { - "locate-path": "^3.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" } }, "findit": { @@ -2566,58 +2739,56 @@ "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==", "dev": true }, - "flow-parser": { - "version": "0.138.0", - "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.138.0.tgz", - "integrity": "sha512-LFnTyjrv39UvCWl8NOcpByr/amj8a5k5z7isO2wv4T43nNrUnHQwX3rarTz9zcpHXkDAQv6X4MfQ4ZzJUptpbw==", - "dev": true - }, - "flow-remove-types": { - "version": "2.138.0", - "resolved": "https://registry.npmjs.org/flow-remove-types/-/flow-remove-types-2.138.0.tgz", - "integrity": "sha512-gWZYpCAcpX5SD7j1S5DrWLWm+ir5LXkkRTrCokTdO5aW6M1cqQmHN5lxwoQTqkP8PfgXI8ILD810TL9CvexpgA==", - "dev": true, - "requires": { - "flow-parser": "^0.138.0", - "pirates": "^3.0.2", - "vlq": "^0.2.1" - } - }, "foreground-child": { - "version": "1.5.6", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", - "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", "dev": true, "requires": { - "cross-spawn": "^4", - "signal-exit": "^3.0.0" + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" }, "dependencies": { "cross-spawn": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", - "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" } }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" + "shebang-regex": "^3.0.0" } }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } } } }, @@ -2698,6 +2869,12 @@ } } }, + "fromentries": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", + "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", + "dev": true + }, "fs-exists-cached": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-exists-cached/-/fs-exists-cached-1.0.0.tgz", @@ -2711,22 +2888,16 @@ "dev": true }, "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "optional": true }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, "function-loop": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/function-loop/-/function-loop-1.0.2.tgz", - "integrity": "sha512-Iw4MzMfS3udk/rqxTiDDCllhGwlOrsr50zViTOO/W6lS/9y6B1J0BD2VZzrnWUYBJsl3aeqjgR5v7bWWhZSYbA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/function-loop/-/function-loop-2.0.1.tgz", + "integrity": "sha512-ktIR+O6i/4h+j/ZhZJNdzeI4i9lEPeEK6UPR2EVyTVBqOwcU3Za9xYKLH64ZR9HmcROyRrOkizNyjjtWJzDDkQ==", "dev": true }, "functional-red-black-tree": { @@ -2794,6 +2965,12 @@ "integrity": "sha512-ug6DAZoNgWm6q5KhPFA+hzXfBLFQu5sTXxPpv44DmE0A2g+CiHoq9LTVdkXpZMkYVMoGw83F6W+WT0h0MFMK/w==", "dev": true }, + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -2812,6 +2989,12 @@ "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", "dev": true }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, "get-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", @@ -2958,15 +3141,6 @@ "har-schema": "^2.0.0" } }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -2989,12 +3163,13 @@ } }, "hasha": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-3.0.0.tgz", - "integrity": "sha1-UqMvq4Vp1BymmmH/GiFPjrfIvTk=", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", + "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", "dev": true, "requires": { - "is-stream": "^1.0.1" + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" } }, "hashring": { @@ -3007,12 +3182,6 @@ "simple-lru-cache": "0.0.x" } }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "hpack.js": { "version": "2.1.6", "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", @@ -3367,15 +3536,6 @@ "binary-extensions": "^2.0.0" } }, - "is-core-module": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.1.0.tgz", - "integrity": "sha512-YcV7BgVMRFRua2FqQzKtTDMz8iCuLEyGKjr70q8Zm1yy2qKcurbFEd79PAdHV77oL3NrAaOVQIbMmiHQCHB7ZA==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -3446,9 +3606,9 @@ "dev": true }, "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", "dev": true }, "is-typedarray": { @@ -3463,6 +3623,12 @@ "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -3482,33 +3648,30 @@ "dev": true }, "istanbul-lib-coverage": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", - "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", "dev": true }, "istanbul-lib-hook": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.7.tgz", - "integrity": "sha512-vrRztU9VRRFDyC+aklfLoeXyNdTfga2EI3udDGn4cZ6fpSXpHLV9X6CHvfoMCPtggg8zvDDmC4b9xfu0z6/llA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", "dev": true, "requires": { - "append-transform": "^1.0.0" + "append-transform": "^2.0.0" } }, "istanbul-lib-instrument": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", - "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", "dev": true, "requires": { - "@babel/generator": "^7.4.0", - "@babel/parser": "^7.4.3", - "@babel/template": "^7.4.0", - "@babel/traverse": "^7.4.3", - "@babel/types": "^7.4.0", - "istanbul-lib-coverage": "^2.0.5", - "semver": "^6.0.0" + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" }, "dependencies": { "semver": { @@ -3520,71 +3683,145 @@ } }, "istanbul-lib-processinfo": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-1.0.0.tgz", - "integrity": "sha512-FY0cPmWa4WoQNlvB8VOcafiRoB5nB+l2Pz2xGuXHRSy1KM8QFOYfz/rN+bGMCAeejrY3mrpF5oJHcN0s/garCg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", + "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", "dev": true, "requires": { "archy": "^1.0.0", - "cross-spawn": "^6.0.5", - "istanbul-lib-coverage": "^2.0.3", - "rimraf": "^2.6.3", - "uuid": "^3.3.2" - } - }, - "istanbul-lib-report": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz", - "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==", - "dev": true, - "requires": { - "istanbul-lib-coverage": "^2.0.5", - "make-dir": "^2.1.0", - "supports-color": "^6.1.0" + "cross-spawn": "^7.0.0", + "istanbul-lib-coverage": "^3.0.0-alpha.1", + "make-dir": "^3.0.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^3.3.3" }, "dependencies": { - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" } - } - } - }, + }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "istanbul-lib-source-maps": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz", - "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", + "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", "dev": true, "requires": { "debug": "^4.1.1", - "istanbul-lib-coverage": "^2.0.5", - "make-dir": "^2.1.0", - "rimraf": "^2.6.3", + "istanbul-lib-coverage": "^3.0.0", "source-map": "^0.6.1" }, "dependencies": { "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "dev": true, "requires": { "ms": "2.1.2" } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true } } }, "istanbul-reports": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.7.tgz", - "integrity": "sha512-uu1F/L1o5Y6LzPVSVZXNOoD/KXpJue9aeLRd0sM9uMXfZvzomB0WxVamWb5ue8kA2vVWEmW7EG+A5n3f1kqHKg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", + "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", "dev": true, "requires": { - "html-escaper": "^2.0.0" + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" } }, "isurl": { @@ -3709,12 +3946,6 @@ "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", "dev": true }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, "json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -3744,6 +3975,15 @@ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, + "json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -3821,6 +4061,36 @@ "type-check": "~0.3.2" } }, + "libtap": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/libtap/-/libtap-1.1.1.tgz", + "integrity": "sha512-Fye8fh1+G7E8qqmjQaY+pXGxy7HM0S6bqCCJFLa16+g2jODBByxbJFDpjbDNF69wfRVyvJ+foLZc1WTIv7dx+g==", + "dev": true, + "requires": { + "async-hook-domain": "^2.0.1", + "bind-obj-methods": "^3.0.0", + "diff": "^4.0.2", + "function-loop": "^2.0.1", + "minipass": "^3.1.1", + "own-or": "^1.0.0", + "own-or-env": "^1.0.1", + "signal-exit": "^3.0.2", + "stack-utils": "^2.0.1", + "tap-parser": "^10.0.1", + "tap-yaml": "^1.0.0", + "tcompare": "^5.0.1", + "trivial-deferred": "^1.0.1", + "yapool": "^1.0.0" + }, + "dependencies": { + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + } + } + }, "light-my-request": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-3.8.0.tgz", @@ -4148,26 +4418,13 @@ } } }, - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - } - }, "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "p-locate": "^4.1.0" } }, "lodash": { @@ -4306,29 +4563,22 @@ } }, "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" + "semver": "^6.0.0" }, "dependencies": { - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } }, - "make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, "markdown-it": { "version": "8.4.2", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz", @@ -4389,15 +4639,6 @@ "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", "dev": true }, - "merge-source-map": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", - "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", - "dev": true, - "requires": { - "source-map": "^0.6.1" - } - }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -4687,12 +4928,6 @@ "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", "dev": true }, - "nested-error-stacks": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz", - "integrity": "sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug==", - "dev": true - }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -4779,36 +5014,21 @@ "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==" }, - "node-modules-regexp": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", - "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", - "dev": true - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", "dev": true, "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - }, - "dependencies": { - "resolve": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", - "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", - "dev": true, - "requires": { - "is-core-module": "^2.1.0", - "path-parse": "^1.0.6" - } - } + "process-on-spawn": "^1.0.0" } }, + "node-releases": { + "version": "1.1.72", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.72.tgz", + "integrity": "sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw==", + "dev": true + }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -4850,36 +5070,64 @@ "dev": true }, "nyc": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-14.1.1.tgz", - "integrity": "sha512-OI0vm6ZGUnoGZv/tLdZ2esSVzDwUC88SNs+6JoSOMVxA+gKMB8Tk7jBwgemLx4O40lhhvZCVw1C+OYLOBOPXWw==", - "dev": true, - "requires": { - "archy": "^1.0.0", - "caching-transform": "^3.0.2", - "convert-source-map": "^1.6.0", - "cp-file": "^6.2.0", - "find-cache-dir": "^2.1.0", - "find-up": "^3.0.0", - "foreground-child": "^1.5.6", - "glob": "^7.1.3", - "istanbul-lib-coverage": "^2.0.5", - "istanbul-lib-hook": "^2.0.7", - "istanbul-lib-instrument": "^3.3.0", - "istanbul-lib-report": "^2.0.8", - "istanbul-lib-source-maps": "^3.0.6", - "istanbul-reports": "^2.2.4", - "js-yaml": "^3.13.1", - "make-dir": "^2.1.0", - "merge-source-map": "^1.1.0", - "resolve-from": "^4.0.0", - "rimraf": "^2.6.3", + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", + "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", + "dev": true, + "requires": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^2.0.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", "signal-exit": "^3.0.2", - "spawn-wrap": "^1.4.2", - "test-exclude": "^5.2.3", - "uuid": "^3.3.2", - "yargs": "^13.2.2", - "yargs-parser": "^13.0.0" + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "dependencies": { + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } } }, "oauth-sign": { @@ -4944,12 +5192,6 @@ "word-wrap": "~1.2.3" } }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true - }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -4999,12 +5241,12 @@ } }, "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "requires": { - "p-limit": "^2.0.0" + "p-limit": "^2.2.0" } }, "p-map": { @@ -5032,13 +5274,13 @@ "dev": true }, "package-hash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-3.0.0.tgz", - "integrity": "sha512-lOtmukMDVvtkL84rJHI7dpTYq+0rli8N2wlnqUcBuDWCfVhRUfOmnR9SsoHFMLpACvEV60dX7rd0rFaYDZI+FA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", "dev": true, "requires": { "graceful-fs": "^4.1.15", - "hasha": "^3.0.0", + "hasha": "^5.0.0", "lodash.flattendeep": "^4.4.0", "release-zalgo": "^1.0.0" } @@ -5061,16 +5303,6 @@ "callsites": "^3.0.0" } }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -5078,9 +5310,9 @@ "dev": true }, "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, "path-is-absolute": { @@ -5095,27 +5327,12 @@ "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, "path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", "dev": true }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, "pathval": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", @@ -5129,9 +5346,9 @@ "dev": true }, "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", "dev": true }, "pidusage": { @@ -5169,22 +5386,13 @@ "integrity": "sha512-wXqbqSrIhE58TdrxxlfLwU9eDhrzppQDvGhBEr1gYbzzM4KKo3Y63gSjiDXRKLVS2UOXdPNR2v+KnQgNrs+xUg==", "dev": true }, - "pirates": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-3.0.2.tgz", - "integrity": "sha512-c5CgUJq6H2k6MJz72Ak1F5sN9n9wlSlJyEnwvpm9/y3WB4E3pHBDT2c6PEiS1vyJvq2bUxUAIu0EGf8Cx4Ic7Q==", - "dev": true, - "requires": { - "node-modules-regexp": "^1.0.0" - } - }, "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "requires": { - "find-up": "^3.0.0" + "find-up": "^4.0.0" } }, "platform": { @@ -5220,6 +5428,15 @@ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, + "process-on-spawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", + "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", + "dev": true, + "requires": { + "fromentries": "^1.2.0" + } + }, "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -5291,12 +5508,6 @@ "resolve": "~1.1.7" } }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, "psl": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", @@ -5394,27 +5605,6 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "dev": true }, - "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - } - }, - "read-pkg-up": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", - "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", - "dev": true, - "requires": { - "find-up": "^3.0.0", - "read-pkg": "^3.0.0" - } - }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -6039,9 +6229,9 @@ } }, "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, "source-map-support": { @@ -6052,6 +6242,14 @@ "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } } }, "sparse-bitfield": { @@ -6065,55 +6263,43 @@ } }, "spawn-wrap": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.3.tgz", - "integrity": "sha512-IgB8md0QW/+tWqcavuFgKYR/qIRvJkRLPJDFaoXtLLUaVcCDK0+HeFTkmQHj3eprcYhc+gOl0aEA1w7qZlYezw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", "dev": true, "requires": { - "foreground-child": "^1.5.6", - "mkdirp": "^0.5.0", - "os-homedir": "^1.0.1", - "rimraf": "^2.6.2", + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", "signal-exit": "^3.0.2", - "which": "^1.3.0" + "which": "^2.0.1" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } } }, - "spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz", - "integrity": "sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==", - "dev": true - }, - "spdy": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.1.tgz", - "integrity": "sha512-HeZS3PBdMA+sZSu0qwpCxl3DeALD5ASx8pAX0jZdKXSpPWbQ6SYGnlg3BBmYLx5LtiZrmkAZfErCm2oECBcioA==", + "spdy": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.1.tgz", + "integrity": "sha512-HeZS3PBdMA+sZSu0qwpCxl3DeALD5ASx8pAX0jZdKXSpPWbQ6SYGnlg3BBmYLx5LtiZrmkAZfErCm2oECBcioA==", "dev": true, "requires": { "debug": "^4.1.0", @@ -6189,9 +6375,9 @@ } }, "stack-utils": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.3.tgz", - "integrity": "sha512-WldO+YmqhEpjp23eHZRhOT1NQF51STsbxZ+/AdpFD+EhheFxAe5d0WoK4DQVJkSHacPrJJX3OqRAl9CgHf78pg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-gL//fkxfWUsIlFL2Tl42Cl6+HFALEaB1FU76I/Fy+oZjRreP7OPMXFlGbxM7NQsI0ZpUfw76sHnv0WNYuTb7Iw==", "dev": true, "requires": { "escape-string-regexp": "^2.0.0" @@ -6277,9 +6463,9 @@ } }, "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true }, "strip-final-newline": { @@ -6350,273 +6536,246 @@ "dev": true }, "tap": { - "version": "14.10.8", - "resolved": "https://registry.npmjs.org/tap/-/tap-14.10.8.tgz", - "integrity": "sha512-aamkWefJ0G8GGf9t5LWFtrNF5tfVd8ut/tDUianLF6N4621ERITIl0qkocWCVEnsM6hZnaMKa+SggSAaBlC2tA==", + "version": "15.0.9", + "resolved": "https://registry.npmjs.org/tap/-/tap-15.0.9.tgz", + "integrity": "sha512-bqY5SxEqYKRd37PIUfKBf9HMs/hklyl/fGXkuStr9rYTIGa0/icpSLsm6IVOmx2qT0/TliPNJ6OvS5kddJYHdg==", "dev": true, "requires": { - "@types/react": "^16.9.16", - "async-hook-domain": "^1.1.3", - "bind-obj-methods": "^2.0.0", - "browser-process-hrtime": "^1.0.0", + "@types/react": "^16.9.23", "chokidar": "^3.3.0", - "color-support": "^1.1.0", "coveralls": "^3.0.11", - "diff": "^4.0.1", - "esm": "^3.2.25", "findit": "^2.0.0", - "flow-remove-types": "^2.112.0", - "foreground-child": "^1.3.3", + "foreground-child": "^2.0.0", "fs-exists-cached": "^1.0.0", - "function-loop": "^1.0.2", "glob": "^7.1.6", - "import-jsx": "^3.1.0", - "ink": "^2.6.0", + "import-jsx": "^4.0.0", + "ink": "^2.7.1", "isexe": "^2.0.0", - "istanbul-lib-processinfo": "^1.0.0", + "istanbul-lib-processinfo": "^2.0.2", "jackspeak": "^1.4.0", + "libtap": "^1.1.1", "minipass": "^3.1.1", - "mkdirp": "^0.5.4", - "nyc": "^14.1.1", + "mkdirp": "^1.0.4", + "nyc": "^15.1.0", "opener": "^1.5.1", - "own-or": "^1.0.0", - "own-or-env": "^1.0.1", "react": "^16.12.0", - "rimraf": "^2.7.1", + "rimraf": "^3.0.0", "signal-exit": "^3.0.0", "source-map-support": "^0.5.16", - "stack-utils": "^1.0.2", "tap-mocha-reporter": "^5.0.0", "tap-parser": "^10.0.1", "tap-yaml": "^1.0.0", - "tcompare": "^3.0.0", - "treport": "^1.0.2", - "trivial-deferred": "^1.0.1", - "ts-node": "^8.5.2", - "typescript": "^3.7.2", - "which": "^2.0.2", - "write-file-atomic": "^3.0.1", - "yaml": "^1.7.2", - "yapool": "^1.0.0" + "tcompare": "^5.0.6", + "treport": "^2.0.2", + "which": "^2.0.2" }, "dependencies": { "@babel/code-frame": { - "version": "7.10.4", + "version": "7.12.13", "bundled": true, "dev": true, "requires": { - "@babel/highlight": "^7.10.4" + "@babel/highlight": "^7.12.13" } }, + "@babel/compat-data": { + "version": "7.14.0", + "bundled": true, + "dev": true + }, "@babel/core": { - "version": "7.10.5", + "version": "7.14.0", "bundled": true, "dev": true, "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.10.5", - "@babel/helper-module-transforms": "^7.10.5", - "@babel/helpers": "^7.10.4", - "@babel/parser": "^7.10.5", - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.10.5", - "@babel/types": "^7.10.5", + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-compilation-targets": "^7.13.16", + "@babel/helper-module-transforms": "^7.14.0", + "@babel/helpers": "^7.14.0", + "@babel/parser": "^7.14.0", + "@babel/template": "^7.12.13", + "@babel/traverse": "^7.14.0", + "@babel/types": "^7.14.0", "convert-source-map": "^1.7.0", "debug": "^4.1.0", - "gensync": "^1.0.0-beta.1", + "gensync": "^1.0.0-beta.2", "json5": "^2.1.2", - "lodash": "^4.17.19", - "resolve": "^1.3.2", - "semver": "^5.4.1", + "semver": "^6.3.0", "source-map": "^0.5.0" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "bundled": true, - "dev": true - } } }, "@babel/generator": { - "version": "7.10.5", + "version": "7.14.1", "bundled": true, "dev": true, "requires": { - "@babel/types": "^7.10.5", + "@babel/types": "^7.14.1", "jsesc": "^2.5.1", "source-map": "^0.5.0" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "bundled": true, - "dev": true - } } }, "@babel/helper-annotate-as-pure": { - "version": "7.10.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/types": "^7.10.4" - } - }, - "@babel/helper-builder-react-jsx": { - "version": "7.10.4", + "version": "7.12.13", "bundled": true, "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/types": "^7.12.13" } }, - "@babel/helper-builder-react-jsx-experimental": { - "version": "7.10.5", + "@babel/helper-compilation-targets": { + "version": "7.13.16", "bundled": true, "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.10.4", - "@babel/helper-module-imports": "^7.10.4", - "@babel/types": "^7.10.5" + "@babel/compat-data": "^7.13.15", + "@babel/helper-validator-option": "^7.12.17", + "browserslist": "^4.14.5", + "semver": "^6.3.0" } }, "@babel/helper-function-name": { - "version": "7.10.4", + "version": "7.12.13", "bundled": true, "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.10.4", - "@babel/template": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" } }, "@babel/helper-get-function-arity": { - "version": "7.10.4", + "version": "7.12.13", "bundled": true, "dev": true, "requires": { - "@babel/types": "^7.10.4" + "@babel/types": "^7.12.13" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.10.5", + "version": "7.13.12", "bundled": true, "dev": true, "requires": { - "@babel/types": "^7.10.5" + "@babel/types": "^7.13.12" } }, "@babel/helper-module-imports": { - "version": "7.10.4", + "version": "7.13.12", "bundled": true, "dev": true, "requires": { - "@babel/types": "^7.10.4" + "@babel/types": "^7.13.12" } }, "@babel/helper-module-transforms": { - "version": "7.10.5", + "version": "7.14.0", "bundled": true, "dev": true, "requires": { - "@babel/helper-module-imports": "^7.10.4", - "@babel/helper-replace-supers": "^7.10.4", - "@babel/helper-simple-access": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.10.4", - "@babel/template": "^7.10.4", - "@babel/types": "^7.10.5", - "lodash": "^4.17.19" + "@babel/helper-module-imports": "^7.13.12", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-simple-access": "^7.13.12", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/helper-validator-identifier": "^7.14.0", + "@babel/template": "^7.12.13", + "@babel/traverse": "^7.14.0", + "@babel/types": "^7.14.0" } }, "@babel/helper-optimise-call-expression": { - "version": "7.10.4", + "version": "7.12.13", "bundled": true, "dev": true, "requires": { - "@babel/types": "^7.10.4" + "@babel/types": "^7.12.13" } }, "@babel/helper-plugin-utils": { - "version": "7.10.4", + "version": "7.13.0", "bundled": true, "dev": true }, "@babel/helper-replace-supers": { - "version": "7.10.4", + "version": "7.13.12", "bundled": true, "dev": true, "requires": { - "@babel/helper-member-expression-to-functions": "^7.10.4", - "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/traverse": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.12" } }, "@babel/helper-simple-access": { - "version": "7.10.4", + "version": "7.13.12", "bundled": true, "dev": true, "requires": { - "@babel/template": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/types": "^7.13.12" } }, "@babel/helper-split-export-declaration": { - "version": "7.10.4", + "version": "7.12.13", "bundled": true, "dev": true, "requires": { - "@babel/types": "^7.10.4" + "@babel/types": "^7.12.13" } }, "@babel/helper-validator-identifier": { - "version": "7.10.4", + "version": "7.14.0", + "bundled": true, + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.12.17", "bundled": true, "dev": true }, "@babel/helpers": { - "version": "7.10.4", + "version": "7.14.0", "bundled": true, "dev": true, "requires": { - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/template": "^7.12.13", + "@babel/traverse": "^7.14.0", + "@babel/types": "^7.14.0" } }, "@babel/highlight": { - "version": "7.10.4", + "version": "7.14.0", "bundled": true, "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.10.4", + "@babel/helper-validator-identifier": "^7.14.0", "chalk": "^2.0.0", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.10.5", + "version": "7.14.1", "bundled": true, "dev": true }, "@babel/plugin-proposal-object-rest-spread": { - "version": "7.10.4", + "version": "7.13.8", "bundled": true, "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/plugin-syntax-object-rest-spread": "^7.8.0", - "@babel/plugin-transform-parameters": "^7.10.4" + "@babel/compat-data": "^7.13.8", + "@babel/helper-compilation-targets": "^7.13.8", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.13.0" } }, "@babel/plugin-syntax-jsx": { - "version": "7.10.4", + "version": "7.12.13", "bundled": true, "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.10.4" + "@babel/helper-plugin-utils": "^7.12.13" } }, "@babel/plugin-syntax-object-rest-spread": { @@ -6628,106 +6787,100 @@ } }, "@babel/plugin-transform-destructuring": { - "version": "7.10.4", + "version": "7.13.17", "bundled": true, "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.10.4" + "@babel/helper-plugin-utils": "^7.13.0" } }, "@babel/plugin-transform-parameters": { - "version": "7.10.5", + "version": "7.13.0", "bundled": true, "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.10.4", - "@babel/helper-plugin-utils": "^7.10.4" + "@babel/helper-plugin-utils": "^7.13.0" } }, "@babel/plugin-transform-react-jsx": { - "version": "7.10.4", + "version": "7.13.12", "bundled": true, "dev": true, "requires": { - "@babel/helper-builder-react-jsx": "^7.10.4", - "@babel/helper-builder-react-jsx-experimental": "^7.10.4", - "@babel/helper-plugin-utils": "^7.10.4", - "@babel/plugin-syntax-jsx": "^7.10.4" + "@babel/helper-annotate-as-pure": "^7.12.13", + "@babel/helper-module-imports": "^7.13.12", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-jsx": "^7.12.13", + "@babel/types": "^7.13.12" } }, "@babel/template": { - "version": "7.10.4", + "version": "7.12.13", "bundled": true, "dev": true, "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/parser": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" } }, "@babel/traverse": { - "version": "7.10.5", + "version": "7.14.0", "bundled": true, "dev": true, "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.10.5", - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.10.4", - "@babel/parser": "^7.10.5", - "@babel/types": "^7.10.5", + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.14.0", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.14.0", + "@babel/types": "^7.14.0", "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.19" + "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.10.5", + "version": "7.14.1", "bundled": true, "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "lodash": "^4.17.19", + "@babel/helper-validator-identifier": "^7.14.0", "to-fast-properties": "^2.0.0" } }, - "@types/color-name": { - "version": "1.1.1", - "bundled": true, - "dev": true - }, "@types/prop-types": { "version": "15.7.3", "bundled": true, "dev": true }, "@types/react": { - "version": "16.9.43", + "version": "16.14.6", "bundled": true, "dev": true, "requires": { "@types/prop-types": "*", - "csstype": "^2.2.0" + "@types/scheduler": "*", + "csstype": "^3.0.2" } }, + "@types/scheduler": { + "version": "0.16.1", + "bundled": true, + "dev": true + }, "@types/yoga-layout": { "version": "1.9.2", "bundled": true, "dev": true }, "ansi-escapes": { - "version": "4.3.1", + "version": "4.3.2", "bundled": true, "dev": true, "requires": { - "type-fest": "^0.11.0" + "type-fest": "^0.21.3" } }, - "ansi-regex": { - "version": "5.0.0", - "bundled": true, - "dev": true - }, "ansi-styles": { "version": "3.2.1", "bundled": true, @@ -6756,6 +6909,32 @@ "bundled": true, "dev": true }, + "balanced-match": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "browserslist": { + "version": "4.16.6", + "bundled": true, + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" + } + }, "caller-callsite": { "version": "2.0.0", "bundled": true, @@ -6777,6 +6956,11 @@ "bundled": true, "dev": true }, + "caniuse-lite": { + "version": "1.0.30001223", + "bundled": true, + "dev": true + }, "cardinal": { "version": "2.1.1", "bundled": true, @@ -6831,38 +7015,45 @@ "bundled": true, "dev": true }, + "colorette": { + "version": "1.2.2", + "bundled": true, + "dev": true + }, + "commondir": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, "convert-source-map": { "version": "1.7.0", "bundled": true, "dev": true, "requires": { "safe-buffer": "~5.1.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true - } } }, "csstype": { - "version": "2.6.11", + "version": "3.0.8", "bundled": true, "dev": true }, "debug": { - "version": "4.1.1", + "version": "4.3.1", "bundled": true, "dev": true, "requires": { - "ms": "^2.1.1" + "ms": "2.1.2" } }, - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "electron-to-chromium": { + "version": "1.3.727", + "bundled": true, "dev": true }, "emoji-regex": { @@ -6870,6 +7061,11 @@ "bundled": true, "dev": true }, + "escalade": { + "version": "3.1.1", + "bundled": true, + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "bundled": true, @@ -6885,11 +7081,48 @@ "bundled": true, "dev": true }, + "find-cache-dir": { + "version": "3.3.1", + "bundled": true, + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, "gensync": { - "version": "1.0.0-beta.1", + "version": "1.0.0-beta.2", "bundled": true, "dev": true }, + "glob": { + "version": "7.1.7", + "bundled": true, + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "globals": { "version": "11.12.0", "bundled": true, @@ -6901,7 +7134,7 @@ "dev": true }, "import-jsx": { - "version": "3.1.0", + "version": "4.0.0", "bundled": true, "dev": true, "requires": { @@ -6910,9 +7143,26 @@ "@babel/plugin-transform-destructuring": "^7.5.0", "@babel/plugin-transform-react-jsx": "^7.3.0", "caller-path": "^2.0.0", - "resolve-from": "^3.0.0" + "find-cache-dir": "^3.2.0", + "make-dir": "^3.0.2", + "resolve-from": "^3.0.0", + "rimraf": "^3.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" } }, + "inherits": { + "version": "2.0.4", + "bundled": true, + "dev": true + }, "ink": { "version": "2.7.1", "bundled": true, @@ -6939,11 +7189,10 @@ }, "dependencies": { "ansi-styles": { - "version": "4.2.1", + "version": "4.3.0", "bundled": true, "dev": true, "requires": { - "@types/color-name": "^1.1.1", "color-convert": "^2.0.1" } }, @@ -6975,7 +7224,7 @@ "dev": true }, "supports-color": { - "version": "7.1.0", + "version": "7.2.0", "bundled": true, "dev": true, "requires": { @@ -7008,17 +7257,20 @@ "dev": true }, "json5": { - "version": "2.1.3", + "version": "2.2.0", "bundled": true, "dev": true, "requires": { "minimist": "^1.2.5" } }, - "lodash": { - "version": "4.17.19", + "locate-path": { + "version": "5.0.0", "bundled": true, - "dev": true + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } }, "lodash.throttle": { "version": "4.1.1", @@ -7123,11 +7375,27 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, + "make-dir": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, "mimic-fn": { "version": "2.1.0", "bundled": true, "dev": true }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, "minimist": { "version": "1.2.5", "bundled": true, @@ -7139,38 +7407,84 @@ "dev": true, "requires": { "yallist": "^4.0.0" - }, - "dependencies": { - "yallist": { - "version": "4.0.0", - "bundled": true, - "dev": true - } } }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, "ms": { "version": "2.1.2", "bundled": true, "dev": true }, + "node-releases": { + "version": "1.1.71", + "bundled": true, + "dev": true + }, "object-assign": { "version": "4.1.1", "bundled": true, "dev": true }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1" + } + }, "onetime": { - "version": "5.1.0", + "version": "5.1.2", "bundled": true, "dev": true, "requires": { "mimic-fn": "^2.1.0" } }, - "path-parse": { - "version": "1.0.6", + "p-limit": { + "version": "2.3.0", + "bundled": true, + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "bundled": true, + "dev": true + }, + "path-exists": { + "version": "4.0.0", "bundled": true, "dev": true }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "bundled": true, + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, "prop-types": { "version": "15.7.2", "bundled": true, @@ -7210,14 +7524,6 @@ "esprima": "~4.0.0" } }, - "resolve": { - "version": "1.17.0", - "bundled": true, - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, "resolve-from": { "version": "3.0.0", "bundled": true, @@ -7232,6 +7538,19 @@ "signal-exit": "^3.0.2" } }, + "rimraf": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true, + "dev": true + }, "scheduler": { "version": "0.18.0", "bundled": true, @@ -7242,7 +7561,7 @@ } }, "semver": { - "version": "5.7.1", + "version": "6.3.0", "bundled": true, "dev": true }, @@ -7262,11 +7581,10 @@ }, "dependencies": { "ansi-styles": { - "version": "4.2.1", + "version": "4.3.0", "bundled": true, "dev": true, "requires": { - "@types/color-name": "^1.1.1", "color-convert": "^2.0.1" } }, @@ -7285,6 +7603,11 @@ } } }, + "source-map": { + "version": "0.5.7", + "bundled": true, + "dev": true + }, "string-length": { "version": "3.1.0", "bundled": true, @@ -7315,21 +7638,28 @@ } }, "string-width": { - "version": "4.2.0", + "version": "4.2.2", "bundled": true, "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "bundled": true, + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } } }, "supports-color": { @@ -7341,7 +7671,7 @@ } }, "tap-parser": { - "version": "10.0.1", + "version": "10.1.0", "bundled": true, "dev": true, "requires": { @@ -7364,13 +7694,13 @@ "dev": true }, "treport": { - "version": "1.0.2", + "version": "2.0.2", "bundled": true, "dev": true, "requires": { "cardinal": "^2.1.1", "chalk": "^3.0.0", - "import-jsx": "^3.1.0", + "import-jsx": "^4.0.0", "ink": "^2.6.0", "ms": "^2.1.2", "string-length": "^3.1.0", @@ -7379,11 +7709,10 @@ }, "dependencies": { "ansi-styles": { - "version": "4.2.1", + "version": "4.3.0", "bundled": true, "dev": true, "requires": { - "@types/color-name": "^1.1.1", "color-convert": "^2.0.1" } }, @@ -7415,7 +7744,7 @@ "dev": true }, "supports-color": { - "version": "7.1.0", + "version": "7.2.0", "bundled": true, "dev": true, "requires": { @@ -7425,7 +7754,7 @@ } }, "type-fest": { - "version": "0.11.0", + "version": "0.21.3", "bundled": true, "dev": true }, @@ -7480,12 +7809,16 @@ "strip-ansi": "^6.0.0" }, "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "bundled": true, + "dev": true + }, "ansi-styles": { - "version": "4.2.1", + "version": "4.3.0", "bundled": true, "dev": true, "requires": { - "@types/color-name": "^1.1.1", "color-convert": "^2.0.1" } }, @@ -7501,16 +7834,34 @@ "version": "1.1.4", "bundled": true, "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } } } }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "4.0.0", + "bundled": true, + "dev": true + }, "yaml": { - "version": "1.10.0", + "version": "1.10.2", "bundled": true, "dev": true }, "yoga-layout-prebuilt": { - "version": "1.9.6", + "version": "1.10.0", "bundled": true, "dev": true, "requires": { @@ -7536,9 +7887,9 @@ }, "dependencies": { "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "dev": true, "requires": { "ms": "2.1.2" @@ -7579,12 +7930,20 @@ } }, "tcompare": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/tcompare/-/tcompare-3.0.4.tgz", - "integrity": "sha512-Q3TitMVK59NyKgQyFh+857wTAUE329IzLDehuPgU4nF5e8g+EUQ+yUbjUy1/6ugiNnXztphT+NnqlCXolv9P3A==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/tcompare/-/tcompare-5.0.6.tgz", + "integrity": "sha512-OvO7omN/wkdsKzmOqr3sQFfLbghs/2X5mwSkcfgRiXZshfPnTsAs3IRf1RixR/Pff26qG/r9ogcZMpV0YdeGXg==", "dev": true, "requires": { - "diff-frag": "^1.0.1" + "diff": "^4.0.2" + }, + "dependencies": { + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + } } }, "temp": { @@ -7608,15 +7967,14 @@ } }, "test-exclude": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", - "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, "requires": { - "glob": "^7.1.3", - "minimatch": "^3.0.4", - "read-pkg-up": "^4.0.0", - "require-main-filename": "^2.0.0" + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" } }, "text-table": { @@ -7697,27 +8055,6 @@ "integrity": "sha1-N21NKdlR1jaKb3oK6FwvTV4GWPM=", "dev": true }, - "ts-node": { - "version": "8.10.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", - "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", - "dev": true, - "requires": { - "arg": "^4.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "source-map-support": "^0.5.17", - "yn": "3.1.1" - }, - "dependencies": { - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - } - } - }, "tslib": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", @@ -7784,12 +8121,6 @@ "is-typedarray": "^1.0.0" } }, - "typescript": { - "version": "3.9.7", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", - "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", - "dev": true - }, "uc.micro": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", @@ -7888,16 +8219,6 @@ "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", "dev": true }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -7924,12 +8245,6 @@ "extsprintf": "^1.2.0" } }, - "vlq": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", - "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", - "dev": true - }, "wbuf": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", @@ -8056,9 +8371,9 @@ "dev": true }, "y18n": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", - "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", "dev": true }, "yallist": { @@ -8080,88 +8395,119 @@ "dev": true }, "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "dev": true, "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^3.0.0", + "string-width": "^4.2.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" + "yargs-parser": "^18.1.2" }, "dependencies": { "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "dev": true }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", "dev": true, "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" } }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", "dev": true, "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" } }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.0" } }, "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" } } } }, "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" } - }, - "yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true } } } diff --git a/package.json b/package.json index ff2d9c453b..ecc211ff91 100644 --- a/package.json +++ b/package.json @@ -192,7 +192,7 @@ "rimraf": "^2.6.3", "should": "*", "sinon": "^4.5.0", - "tap": "^14.10.8", + "tap": "^15.0.9", "temp": "^0.8.1", "through": "^2.3.6", "when": "*" From 9e9816ca0792c45bda69436b9b85bb6854a7f618 Mon Sep 17 00:00:00 2001 From: Michael Goin Date: Thu, 3 Jun 2021 15:21:39 -0700 Subject: [PATCH 02/13] Starts fixing beforeach/aftereach in unit tests for tap 15 compat. --- test/unit/agent/agent.test.js | 74 +++++------------ test/unit/agent/intrinsics.test.js | 16 +--- test/unit/agent/synthetics.test.js | 7 +- test/unit/aggregators/base-aggregator.test.js | 24 ++---- .../unit/aggregators/event-aggregator.test.js | 7 +- test/unit/api/api-add-ignoring-rule.test.js | 8 +- test/unit/api/api-add-naming-rule.test.js | 8 +- test/unit/api/api-custom-attributes.test.js | 8 +- test/unit/api/api-custom-metrics.test.js | 8 +- .../unit/api/api-get-linking-metadata.test.js | 8 +- test/unit/api/api-get-trace-metadata.test.js | 8 +- .../api/api-instrument-conglomerate.test.js | 8 +- .../unit/api/api-instrument-datastore.test.js | 8 +- .../api/api-instrument-loaded-module.test.js | 8 +- .../api/api-instrument-webframework.test.js | 8 +- test/unit/api/api-instrument.test.js | 8 +- test/unit/api/api-notice-error.test.js | 8 +- test/unit/api/api-record-custom-event.test.js | 8 +- test/unit/api/api-set-controller-name.test.js | 8 +- test/unit/api/api-set-dispatcher.test.js | 8 +- .../unit/api/api-set-transaction-name.test.js | 8 +- test/unit/api/api-shutdown.test.js | 35 +++----- .../api-start-background-transaction.test.js | 8 +- test/unit/api/api-start-segment.test.js | 8 +- .../api/api-start-web-transaction.test.js | 8 +- .../api/api-supportability-metrics.test.js | 7 +- test/unit/api/api-transaction-handle.test.js | 8 +- test/unit/api/stub.test.js | 3 +- test/unit/attributes.test.js | 30 +++---- test/unit/collector/api-connect.test.js | 72 +++++------------ test/unit/collector/api-login.test.js | 80 +++++-------------- test/unit/error_events.test.js | 24 ++---- test/unit/facts.test.js | 26 ++---- test/unit/parsed-statement.test.js | 37 +++------ test/unit/prioritized-attributes.test.js | 42 ++++------ test/unit/protocols.test.js | 7 +- test/unit/trace-segment.test.js | 33 +++----- 37 files changed, 188 insertions(+), 496 deletions(-) diff --git a/test/unit/agent/agent.test.js b/test/unit/agent/agent.test.js index 0da4a1bdf2..8c73edf382 100644 --- a/test/unit/agent/agent.test.js +++ b/test/unit/agent/agent.test.js @@ -36,17 +36,14 @@ tap.test('when loaded with defaults', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { // Load agent with default 'stopped' state agent = helper.loadMockedAgent(null, false) - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) t.test('bootstraps its configuration', (t) => { @@ -161,19 +158,17 @@ tap.test('when forcing transaction ignore status', (t) => { let agentInstance = null - t.beforeEach((done) => { + t.beforeEach(() => { const config = configurator.initialize({ rules: {ignore: [ /^\/ham_snadwich\/ignore/ ]} }) agentInstance = new Agent(config) - done() }) - t.afterEach((done) => { + t.afterEach(() => { agentInstance = null - done() }) t.test('should not error when forcing an ignore', (t) => { @@ -307,15 +302,14 @@ tap.test('when starting', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { nock.disableNetConnect() // Load agent with default 'stopped' state agent = helper.loadMockedAgent(null, false) - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null @@ -326,8 +320,6 @@ tap.test('when starting', (t) => { } nock.enableNetConnect() - - done() }) t.test('should require a callback', (t) => { @@ -466,7 +458,7 @@ tap.test('initial harvest', (t) => { let connect = null let settings = null - t.beforeEach((done) => { + t.beforeEach(() => { nock.disableNetConnect() global.setInterval = (callback) => { @@ -503,11 +495,9 @@ tap.test('initial harvest', (t) => { settings = nock(URL) .post(helper.generateCollectorPath('agent_settings', RUN_ID)) .reply(200, {return_value: []}) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { global.setInterval = origInterval helper.unloadAgent(agent) @@ -520,8 +510,6 @@ tap.test('initial harvest', (t) => { } nock.enableNetConnect() - - done() }) t.test('should not blow up when harvest cycle runs', (t) => { @@ -583,17 +571,14 @@ tap.test('when stopping', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { // Load agent with default 'stopped' state agent = helper.loadMockedAgent(null, false) - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) t.test('should require a callback', (t) => { @@ -632,15 +617,14 @@ tap.test('when stopping after connected', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { nock.disableNetConnect() // Load agent with default 'stopped' state agent = helper.loadMockedAgent(null, false) - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null @@ -651,8 +635,6 @@ tap.test('when stopping after connected', (t) => { } nock.enableNetConnect() - - done() }) t.test('should call shutdown', (t) => { @@ -691,7 +673,7 @@ tap.test('when connected', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { nock.disableNetConnect() // Load agent with default 'stopped' state @@ -705,11 +687,9 @@ tap.test('when connected', (t) => { detect_gcp: false, detect_docker: false } - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null @@ -720,8 +700,6 @@ tap.test('when connected', (t) => { } nock.enableNetConnect() - - done() }) t.test('should update the metric apdexT value after connect', (t) => { @@ -798,18 +776,14 @@ tap.test('when handling finished transactions', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { // Load agent with default 'stopped' state agent = helper.loadMockedAgent(null, false) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) t.test('should capture the trace off a finished transaction', (t) => { @@ -902,18 +876,14 @@ tap.test('when sampling_target changes', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { // Load agent with default 'stopped' state agent = helper.loadMockedAgent(null, false) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) t.test('should adjust the current sampling target', (t) => { @@ -947,20 +917,16 @@ tap.test('when event_harvest_config updated on connect with a valid config', (t) let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { // Load agent with default 'stopped' state agent = helper.loadMockedAgent(null, false) agent.config.onConnect({event_harvest_config: validHarvestConfig}) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) t.test('should generate ReportPeriod supportability', (t) => { diff --git a/test/unit/agent/intrinsics.test.js b/test/unit/agent/intrinsics.test.js index 62e1f11f4f..41945f9cda 100644 --- a/test/unit/agent/intrinsics.test.js +++ b/test/unit/agent/intrinsics.test.js @@ -20,19 +20,15 @@ tap.test('when CAT is disabled', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent({ cross_application_tracer: {enabled: false} }) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) crossAgentTests.forEach(function(test) { @@ -146,7 +142,7 @@ tap.test('when CAT is enabled', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { // App name from test data agent = helper.loadMockedAgent({ apdex_t: 0.050, @@ -155,15 +151,11 @@ tap.test('when CAT is enabled', (t) => { agent.config.applications = function newFake() { return ['testAppName'] } - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) const expectedDurationsInSeconds = [0.030, 0.150, 0.500] diff --git a/test/unit/agent/synthetics.test.js b/test/unit/agent/synthetics.test.js index 958fed1259..9fd1e82faf 100644 --- a/test/unit/agent/synthetics.test.js +++ b/test/unit/agent/synthetics.test.js @@ -14,17 +14,14 @@ tap.test('synthetics transaction traces', (t) => { let agent - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent({ trusted_account_ids: [357] }) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should include synthetic intrinsics if header is set', (t) => { diff --git a/test/unit/aggregators/base-aggregator.test.js b/test/unit/aggregators/base-aggregator.test.js index dd25acf7cb..7db2aa1a8a 100644 --- a/test/unit/aggregators/base-aggregator.test.js +++ b/test/unit/aggregators/base-aggregator.test.js @@ -23,7 +23,7 @@ tap.test('scheduling', (t) => { let sendInvocation = 0 let clock = null - t.beforeEach((done) => { + t.beforeEach(() => { fakeCollectorApi = {} fakeCollectorApi[METHOD] = () => {} @@ -39,11 +39,9 @@ tap.test('scheduling', (t) => { baseAggregator.send = () => sendInvocation++ clock = sinon.useFakeTimers() - - done() }) - t.afterEach((done) => { + t.afterEach(() => { baseAggregator = null fakeCollectorApi = null @@ -51,8 +49,6 @@ tap.test('scheduling', (t) => { clock = null sendInvocation = 0 - - done() }) t.test('should consistently invoke send on period', (t) => { @@ -125,7 +121,7 @@ tap.test('send', (t) => { let baseAggregator = null let fakeCollectorApi = null - t.beforeEach((done) => { + t.beforeEach(() => { fakeCollectorApi = {} fakeCollectorApi[METHOD] = () => {} @@ -135,15 +131,11 @@ tap.test('send', (t) => { limit: LIMIT, method: METHOD }, fakeCollectorApi) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { baseAggregator = null fakeCollectorApi = null - - done() }) t.test('should emit proper message with method for starting send', (t) => { @@ -363,7 +355,7 @@ tap.test('reconfigure() should update runid', (t) => { let baseAggregator = null let fakeCollectorApi = null - t.beforeEach((done) => { + t.beforeEach(() => { fakeCollectorApi = {} fakeCollectorApi[METHOD] = () => {} @@ -373,15 +365,11 @@ tap.test('reconfigure() should update runid', (t) => { limit: LIMIT, method: METHOD }, fakeCollectorApi) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { baseAggregator = null fakeCollectorApi = null - - done() }) t.test('reconfigure() should update runid', (t) => { diff --git a/test/unit/aggregators/event-aggregator.test.js b/test/unit/aggregators/event-aggregator.test.js index b66ff7b228..1072afc982 100644 --- a/test/unit/aggregators/event-aggregator.test.js +++ b/test/unit/aggregators/event-aggregator.test.js @@ -26,7 +26,7 @@ tap.test('Event Aggregator', (t) => { let metrics = null let eventAggregator = null - function beforeTest(cb) { + function beforeTest() { metrics = new Metrics(5, {}, {}) eventAggregator = new EventAggregator({ @@ -34,13 +34,10 @@ tap.test('Event Aggregator', (t) => { limit: LIMIT, metricNames: METRIC_NAMES }, {}, metrics) - - cb() } - function afterTest(cb) { + function afterTest() { eventAggregator = null - cb() } t.test('add()', (t) => { diff --git a/test/unit/api/api-add-ignoring-rule.test.js b/test/unit/api/api-add-ignoring-rule.test.js index 68b608132f..7f408c9638 100644 --- a/test/unit/api/api-add-ignoring-rule.test.js +++ b/test/unit/api/api-add-ignoring-rule.test.js @@ -18,18 +18,14 @@ tap.test('Agent API - addIgnoringRule', (t) => { const TEST_URL = '/test/path/31337' const NAME = 'WebTransaction/Uri/test/path/31337' - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() api = new API(agent) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) t.test("exports a function for ignoring certain URLs", (t) => { diff --git a/test/unit/api/api-add-naming-rule.test.js b/test/unit/api/api-add-naming-rule.test.js index dc8141e9ab..88d203a231 100644 --- a/test/unit/api/api-add-naming-rule.test.js +++ b/test/unit/api/api-add-naming-rule.test.js @@ -18,18 +18,14 @@ tap.test('Agent API - addNamingRule', (t) => { const TEST_URL = '/test/path/31337' const NAME = 'WebTransaction/Uri/test/path/31337' - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() api = new API(agent) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) t.test("exports a function for adding naming rules", (t) => { diff --git a/test/unit/api/api-custom-attributes.test.js b/test/unit/api/api-custom-attributes.test.js index ee9363b48a..1af21086a0 100644 --- a/test/unit/api/api-custom-attributes.test.js +++ b/test/unit/api/api-custom-attributes.test.js @@ -18,21 +18,17 @@ tap.test('Agent API - custom attributes', (t) => { let agent = null let api = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() agent.config.attributes.enabled = true agent.config.distributed_tracing.enabled = true api = new API(agent) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) t.test("exports a function for adding multiple custom attributes at once", (t) => { diff --git a/test/unit/api/api-custom-metrics.test.js b/test/unit/api/api-custom-metrics.test.js index 7cf652d499..e16c3230a3 100644 --- a/test/unit/api/api-custom-metrics.test.js +++ b/test/unit/api/api-custom-metrics.test.js @@ -15,18 +15,14 @@ tap.test('Agent API - custom metrics', (t) => { let agent = null let api = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() api = new API(agent) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) t.test('should prepend "Custom" in front of name', (t) => { diff --git a/test/unit/api/api-get-linking-metadata.test.js b/test/unit/api/api-get-linking-metadata.test.js index d224a7a4b0..a745d8a0a4 100644 --- a/test/unit/api/api-get-linking-metadata.test.js +++ b/test/unit/api/api-get-linking-metadata.test.js @@ -15,18 +15,14 @@ tap.test('Agent API - getLinkingMetadata', (t) => { let agent = null let api = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent() api = new API(agent) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) t.test('should return available fields, no DT data, when DT disabled in transaction', (t) => { diff --git a/test/unit/api/api-get-trace-metadata.test.js b/test/unit/api/api-get-trace-metadata.test.js index e463d3523e..fc1b45f948 100644 --- a/test/unit/api/api-get-trace-metadata.test.js +++ b/test/unit/api/api-get-trace-metadata.test.js @@ -15,20 +15,16 @@ tap.test('Agent API - trace metadata', (t) => { let agent = null let api = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() agent.config.distributed_tracing.enabled = true api = new API(agent) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) t.test("exports a trace metadata function", (t) => { diff --git a/test/unit/api/api-instrument-conglomerate.test.js b/test/unit/api/api-instrument-conglomerate.test.js index 3e85076efa..371ad1ff33 100644 --- a/test/unit/api/api-instrument-conglomerate.test.js +++ b/test/unit/api/api-instrument-conglomerate.test.js @@ -17,22 +17,18 @@ tap.test('Agent API - instrumentConglomerate', (t) => { let agent = null let api = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() api = new API(agent) sinon.spy(shimmer, 'registerInstrumentation') - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null shimmer.registerInstrumentation.restore() - - done() }) t.test('should register the instrumentation with shimmer', (t) => { diff --git a/test/unit/api/api-instrument-datastore.test.js b/test/unit/api/api-instrument-datastore.test.js index ec828952e0..53a0e287c6 100644 --- a/test/unit/api/api-instrument-datastore.test.js +++ b/test/unit/api/api-instrument-datastore.test.js @@ -17,22 +17,18 @@ tap.test('Agent API - instrumentDatastore', (t) => { let agent = null let api = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() api = new API(agent) sinon.spy(shimmer, 'registerInstrumentation') - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null shimmer.registerInstrumentation.restore() - - done() }) t.test('should register the instrumentation with shimmer', (t) => { diff --git a/test/unit/api/api-instrument-loaded-module.test.js b/test/unit/api/api-instrument-loaded-module.test.js index 0c8f4268a2..bac28599d9 100644 --- a/test/unit/api/api-instrument-loaded-module.test.js +++ b/test/unit/api/api-instrument-loaded-module.test.js @@ -18,7 +18,7 @@ tap.test('Agent API - instrumentLoadedModule', (t) => { let expressMock let shimHelper - t.beforeEach((done) => { + t.beforeEach(() => { agent = agentHelper.instrumentMockedAgent() api = new API(agent) @@ -30,17 +30,13 @@ tap.test('Agent API - instrumentLoadedModule', (t) => { expressMock.Router = {} shimHelper = new Shim(agent, 'fake') - - done() }) - t.afterEach((done) => { + t.afterEach(() => { agentHelper.unloadAgent(agent) agent = null api = null expressMock = null - - done() }) t.test('should be callable without an error', (t) => { diff --git a/test/unit/api/api-instrument-webframework.test.js b/test/unit/api/api-instrument-webframework.test.js index 5fa1914ff2..1170033506 100644 --- a/test/unit/api/api-instrument-webframework.test.js +++ b/test/unit/api/api-instrument-webframework.test.js @@ -17,22 +17,18 @@ tap.test('Agent API - instrumentWebframework', (t) => { let agent = null let api = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() api = new API(agent) sinon.spy(shimmer, 'registerInstrumentation') - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null shimmer.registerInstrumentation.restore() - - done() }) t.test('should register the instrumentation with shimmer', (t) => { diff --git a/test/unit/api/api-instrument.test.js b/test/unit/api/api-instrument.test.js index 501ad703fc..2c409706c0 100644 --- a/test/unit/api/api-instrument.test.js +++ b/test/unit/api/api-instrument.test.js @@ -17,22 +17,18 @@ tap.test('Agent API - instrument', (t) => { let agent = null let api = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() api = new API(agent) sinon.spy(shimmer, 'registerInstrumentation') - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null shimmer.registerInstrumentation.restore() - - done() }) t.test("exports a function for adding custom instrumentation", (t) => { diff --git a/test/unit/api/api-notice-error.test.js b/test/unit/api/api-notice-error.test.js index c80ffbdf67..8f632bbd70 100644 --- a/test/unit/api/api-notice-error.test.js +++ b/test/unit/api/api-notice-error.test.js @@ -15,20 +15,16 @@ tap.test('Agent API - noticeError', (t) => { let agent = null let api = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() api = new API(agent) agent.config.attributes.enabled = true - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) t.test("should add the error even without a transaction", (t) => { diff --git a/test/unit/api/api-record-custom-event.test.js b/test/unit/api/api-record-custom-event.test.js index c149d80cff..85ab1f7c62 100644 --- a/test/unit/api/api-record-custom-event.test.js +++ b/test/unit/api/api-record-custom-event.test.js @@ -17,23 +17,19 @@ tap.test('Agent API - recordCustomEvent', (t) => { let agent = null let api = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent({ custom_insights_events: { max_samples_stored: MAX_CUSTOM_EVENTS } }) api = new API(agent) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null api = null - - done() }) t.test('can be called without exploding', (t) => { diff --git a/test/unit/api/api-set-controller-name.test.js b/test/unit/api/api-set-controller-name.test.js index 2506535b2e..664205eb65 100644 --- a/test/unit/api/api-set-controller-name.test.js +++ b/test/unit/api/api-set-controller-name.test.js @@ -18,18 +18,14 @@ tap.test('Agent API - setControllerName', (t) => { let agent = null let api = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() api = new API(agent) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) t.test("exports a controller naming function", (t) => { diff --git a/test/unit/api/api-set-dispatcher.test.js b/test/unit/api/api-set-dispatcher.test.js index 1c23751af9..e0f056ca19 100644 --- a/test/unit/api/api-set-dispatcher.test.js +++ b/test/unit/api/api-set-dispatcher.test.js @@ -15,20 +15,16 @@ tap.test('Agent API - dispatch setter', (t) => { let agent = null let api = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() api = new API(agent) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { agent.environment.clearDispatcher() helper.unloadAgent(agent) agent = null - - done() }) t.test("exports a dispatcher setter", (t) => { diff --git a/test/unit/api/api-set-transaction-name.test.js b/test/unit/api/api-set-transaction-name.test.js index f76eecbf5e..2454e9b9ae 100644 --- a/test/unit/api/api-set-transaction-name.test.js +++ b/test/unit/api/api-set-transaction-name.test.js @@ -18,18 +18,14 @@ tap.test('Agent API - setTranasactionName', (t) => { const TEST_URL = '/test/path/31337' const NAME = 'WebTransaction/Uri/test/path/31337' - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() api = new API(agent) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) t.test("exports a transaction naming function", (t) => { diff --git a/test/unit/api/api-shutdown.test.js b/test/unit/api/api-shutdown.test.js index 2c3f6f9f09..1bf1b80cda 100644 --- a/test/unit/api/api-shutdown.test.js +++ b/test/unit/api/api-shutdown.test.js @@ -16,24 +16,16 @@ tap.test('Agent API - shutdown', (t) => { let agent = null let api = null - function setupAgentApi(cb) { + function setupAgentApi() { agent = helper.loadMockedAgent() api = new API(agent) agent.config.attributes.enabled = true - - if (cb) { - cb() - } } - function cleanupAgentApi(cb) { + function cleanupAgentApi() { helper.unloadAgent(agent) agent = null - - if (cb) { - cb() - } } t.test('exports a shutdown function', (t) => { @@ -213,21 +205,21 @@ tap.test('Agent API - shutdown', (t) => { }) t.test('calls stop when timeout is reached and does not forceHarvestAll', (t) => { + setupAgentApi() + const originalSetTimeout = setTimeout let timeoutHandle = null - setupAgentApi(() => { - global.setTimeout = function patchedSetTimeout() { - timeoutHandle = originalSetTimeout.apply(this, arguments) + global.setTimeout = function patchedSetTimeout() { + timeoutHandle = originalSetTimeout.apply(this, arguments) - // This is a hack to keep tap from shutting down test early. - // Is there a better way to do this? - setImmediate(() => { - timeoutHandle.ref() - }) + // This is a hack to keep tap from shutting down test early. + // Is there a better way to do this? + setImmediate(() => { + timeoutHandle.ref() + }) - return timeoutHandle - } - }) + return timeoutHandle + } t.tearDown(() => { timeoutHandle.unref() @@ -343,4 +335,3 @@ tap.test('Agent API - shutdown', (t) => { agent.setState('started') }) }) - diff --git a/test/unit/api/api-start-background-transaction.test.js b/test/unit/api/api-start-background-transaction.test.js index 4764fcf9cc..6f52dae7cd 100644 --- a/test/unit/api/api-start-background-transaction.test.js +++ b/test/unit/api/api-start-background-transaction.test.js @@ -15,18 +15,14 @@ tap.test('Agent API - startBackgroundTransaction', (t) => { let agent = null let api = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() api = new API(agent) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) t.test('should not throw when transaction cannot be created', (t) => { diff --git a/test/unit/api/api-start-segment.test.js b/test/unit/api/api-start-segment.test.js index 5d9dce2de1..39305dbbb5 100644 --- a/test/unit/api/api-start-segment.test.js +++ b/test/unit/api/api-start-segment.test.js @@ -15,18 +15,14 @@ tap.test('Agent API - startSegment', (t) => { let agent = null let api = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() api = new API(agent) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) t.test('should name the segment as provided', (t) => { diff --git a/test/unit/api/api-start-web-transaction.test.js b/test/unit/api/api-start-web-transaction.test.js index fbeef97713..13a630955e 100644 --- a/test/unit/api/api-start-web-transaction.test.js +++ b/test/unit/api/api-start-web-transaction.test.js @@ -15,18 +15,14 @@ tap.test('Agent API - startWebTransaction', (t) => { let agent = null let api = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() api = new API(agent) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) t.test('should not throw when transaction cannot be created', (t) => { diff --git a/test/unit/api/api-supportability-metrics.test.js b/test/unit/api/api-supportability-metrics.test.js index b7db003f03..49b1fba85e 100644 --- a/test/unit/api/api-supportability-metrics.test.js +++ b/test/unit/api/api-supportability-metrics.test.js @@ -19,16 +19,13 @@ tap.test('The API supportability metrics', (t) => { const apiCalls = Object.keys(API.prototype) - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() api = new API(agent) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) for (var i = 0; i < apiCalls.length; i++) { diff --git a/test/unit/api/api-transaction-handle.test.js b/test/unit/api/api-transaction-handle.test.js index 0ac5d80634..11109260a7 100644 --- a/test/unit/api/api-transaction-handle.test.js +++ b/test/unit/api/api-transaction-handle.test.js @@ -15,18 +15,14 @@ tap.test('Agent API - transaction handle', (t) => { let agent = null let api = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() api = new API(agent) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) t.test("exports a function for getting a transaction handle", (t) => { diff --git a/test/unit/api/stub.test.js b/test/unit/api/stub.test.js index a6aad36ad3..e37ad319af 100644 --- a/test/unit/api/stub.test.js +++ b/test/unit/api/stub.test.js @@ -15,9 +15,8 @@ tap.test('Agent API - Stubbed Agent API', (t) => { let api = null - t.beforeEach((done) => { + t.beforeEach(() => { api = new API() - done() }) t.test('should export 29 API calls', (t) => { diff --git a/test/unit/attributes.test.js b/test/unit/attributes.test.js index 1e22f03184..0d43a93631 100644 --- a/test/unit/attributes.test.js +++ b/test/unit/attributes.test.js @@ -19,14 +19,12 @@ tap.test('#addAttribute', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('adds an attribute to instance', (t) => { @@ -62,14 +60,12 @@ tap.test('#addAttributes', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('adds multiple attributes to instance', (t) => { @@ -158,14 +154,12 @@ tap.test('#get', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('gets attributes by destination, truncating values if necessary', (t) => { @@ -213,14 +207,12 @@ tap.test('#hasValidDestination', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should return true if single destination valid', (t) => { @@ -272,14 +264,12 @@ tap.test('#reset', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('resets instance attributes', (t) => { diff --git a/test/unit/collector/api-connect.test.js b/test/unit/collector/api-connect.test.js index 6ed9b3c90e..dbd7b8bde4 100644 --- a/test/unit/collector/api-connect.test.js +++ b/test/unit/collector/api-connect.test.js @@ -50,7 +50,7 @@ tap.test('receiving 200 response, with valid data', (t) => { agent_run_id: RUN_ID } - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() collectorApi = new CollectorApi(agent) @@ -65,11 +65,9 @@ tap.test('receiving 200 response, with valid data', (t) => { connection = nock(CONNECT_URL) .post(helper.generateCollectorPath('connect')) .reply(200, response) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -82,8 +80,6 @@ tap.test('receiving 200 response, with valid data', (t) => { helper.unloadAgent(agent) agent = null collectorApi = null - - done() }) t.test('should not error out', (t) => { @@ -123,7 +119,7 @@ tap.test('succeeds when given a different port number for redirect', (t) => { agent_run_id: RUN_ID } - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() collectorApi = new CollectorApi(agent) @@ -138,11 +134,9 @@ tap.test('succeeds when given a different port number for redirect', (t) => { connection = nock(CONNECT_URL + ':8089') .post(helper.generateCollectorPath('connect')) .reply(200, response) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -155,8 +149,6 @@ tap.test('succeeds when given a different port number for redirect', (t) => { helper.unloadAgent(agent) agent = null collectorApi = null - - done() }) t.test('should not error out', (t) => { @@ -262,7 +254,7 @@ tap.test('succeeds after one 503 on preconnect', (t) => { let bad = null let ssc = null - t.beforeEach((done) => { + t.beforeEach(() => { fastSetTimeoutIncrementRef() nock.disableNetConnect() @@ -280,11 +272,9 @@ tap.test('succeeds after one 503 on preconnect', (t) => { connection = nock(URL) .post(helper.generateCollectorPath('connect')) .reply(200, response) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { restoreSetTimeout() if (!nock.isDone()) { @@ -296,8 +286,6 @@ tap.test('succeeds after one 503 on preconnect', (t) => { nock.enableNetConnect() helper.unloadAgent(agent) - - done() }) t.test('should not error out', (t) => { @@ -355,7 +343,7 @@ tap.test('succeeds after five 503s on preconnect', (t) => { let bad = null let ssc = null - t.beforeEach((done) => { + t.beforeEach(() => { fastSetTimeoutIncrementRef() nock.disableNetConnect() @@ -373,11 +361,9 @@ tap.test('succeeds after five 503s on preconnect', (t) => { connection = nock(URL) .post(helper.generateCollectorPath('connect')) .reply(200, response) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { restoreSetTimeout() if (!nock.isDone()) { @@ -389,8 +375,6 @@ tap.test('succeeds after five 503s on preconnect', (t) => { nock.enableNetConnect() helper.unloadAgent(agent) - - done() }) @@ -444,7 +428,7 @@ tap.test('disconnects on force disconnect (410)', (t) => { let disconnect = null - t.beforeEach((done) => { + t.beforeEach(() => { fastSetTimeoutIncrementRef() nock.disableNetConnect() @@ -454,11 +438,9 @@ tap.test('disconnects on force disconnect (410)', (t) => { const redirectURL = helper.generateCollectorPath('preconnect') disconnect = nock(URL).post(redirectURL).times(1).reply(410, exception) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { restoreSetTimeout() if (!nock.isDone()) { @@ -470,8 +452,6 @@ tap.test('disconnects on force disconnect (410)', (t) => { nock.enableNetConnect() helper.unloadAgent(agent) - - done() }) t.test('should not have errored', (t) => { @@ -513,7 +493,7 @@ tap.test('retries preconnect until forced to disconnect (410)', (t) => { let capturedResponse = null - t.beforeEach((done) => { + t.beforeEach(() => { fastSetTimeoutIncrementRef() nock.disableNetConnect() @@ -524,11 +504,9 @@ tap.test('retries preconnect until forced to disconnect (410)', (t) => { const redirectURL = helper.generateCollectorPath('preconnect') failure = nock(URL).post(redirectURL).times(500).reply(503) disconnect = nock(URL).post(redirectURL).times(1).reply(410, exception) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { restoreSetTimeout() if (!nock.isDone()) { @@ -540,8 +518,6 @@ tap.test('retries preconnect until forced to disconnect (410)', (t) => { nock.enableNetConnect() helper.unloadAgent(agent) - - done() }) t.test('should have received shutdown response', (t) => { @@ -577,7 +553,7 @@ tap.test('retries on receiving invalid license key (401)', (t) => { let success = null let connect = null - t.beforeEach((done) => { + t.beforeEach(() => { fastSetTimeoutIncrementRef() nock.disableNetConnect() @@ -591,11 +567,9 @@ tap.test('retries on receiving invalid license key (401)', (t) => { connect = nock(URL) .post(helper.generateCollectorPath('connect')) .reply(200, {return_value: {agent_run_id: 31338}}) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { restoreSetTimeout() if (!nock.isDone()) { @@ -607,8 +581,6 @@ tap.test('retries on receiving invalid license key (401)', (t) => { nock.enableNetConnect() helper.unloadAgent(agent) - - done() }) t.test('should call the expected number of times', (t) => { @@ -649,7 +621,7 @@ tap.test('retries on misconfigured proxy', (t) => { let success = null let connect = null - t.beforeEach((done) => { + t.beforeEach(() => { fastSetTimeoutIncrementRef() nock.disableNetConnect() @@ -665,11 +637,9 @@ tap.test('retries on misconfigured proxy', (t) => { connect = nock(URL) .post(helper.generateCollectorPath('connect')) .reply(200, {return_value: {agent_run_id: 31338}}) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { sandbox.resetHistory() restoreSetTimeout() @@ -682,8 +652,6 @@ tap.test('retries on misconfigured proxy', (t) => { nock.enableNetConnect() helper.unloadAgent(agent) - - done() }) t.test('should log warning when proxy is misconfigured', (t) => { @@ -730,7 +698,7 @@ tap.test('in a LASP/CSP enabled agent', (t) => { let collectorApi = null let policies = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() agent.config.security_policies_token = SECURITY_POLICIES_TOKEN @@ -739,11 +707,9 @@ tap.test('in a LASP/CSP enabled agent', (t) => { policies = securityPolicies() nock.disableNetConnect() - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -757,8 +723,6 @@ tap.test('in a LASP/CSP enabled agent', (t) => { agent = null collectorApi = null policies = null - - done() }) t.test('should include security policies in api callback response', (t) => { diff --git a/test/unit/collector/api-login.test.js b/test/unit/collector/api-login.test.js index 01936dd000..04e05abe6c 100644 --- a/test/unit/collector/api-login.test.js +++ b/test/unit/collector/api-login.test.js @@ -23,18 +23,16 @@ tap.test('when high_security: true', (t) => { let agent = null let collectorApi = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() agent.config.high_security = true collectorApi = new CollectorApi(agent) nock.disableNetConnect() - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -47,8 +45,6 @@ tap.test('when high_security: true', (t) => { helper.unloadAgent(agent) agent = null collectorApi = null - - done() }) t.test('should send high_security:true in preconnect payload', (t) => { @@ -84,18 +80,16 @@ tap.test('when high_security: false', (t) => { let agent = null let api = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() agent.config.high_security = false api = new CollectorApi(agent) nock.disableNetConnect() - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -108,8 +102,6 @@ tap.test('when high_security: false', (t) => { helper.unloadAgent(agent) agent = null api = null - - done() }) t.test('should send high_security:true in preconnect payload', (t) => { @@ -148,7 +140,7 @@ tap.test('in a LASP-enabled agent', (t) => { let collectorApi = null let policies = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() agent.config.security_policies_token = SECURITY_POLICIES_TOKEN @@ -157,11 +149,9 @@ tap.test('in a LASP-enabled agent', (t) => { policies = securityPolicies() nock.disableNetConnect() - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -175,8 +165,6 @@ tap.test('in a LASP-enabled agent', (t) => { agent = null collectorApi = null policies = null - - done() }) // HSM should never be true when LASP/CSP enabled but payload should still be sent. @@ -310,7 +298,7 @@ tap.test('receiving 200 response, with valid data', (t) => { agent_run_id: RUN_ID } - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() collectorApi = new CollectorApi(agent) @@ -324,11 +312,9 @@ tap.test('receiving 200 response, with valid data', (t) => { connection = nock(URL) .post(helper.generateCollectorPath('connect')) .reply(200, response) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -341,8 +327,6 @@ tap.test('receiving 200 response, with valid data', (t) => { helper.unloadAgent(agent) agent = null collectorApi = null - - done() }) t.test('should not error out', (t) => { @@ -389,7 +373,7 @@ tap.test('receiving 503 response from preconnect', (t) => { let redirection = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() collectorApi = new CollectorApi(agent) @@ -398,11 +382,9 @@ tap.test('receiving 503 response from preconnect', (t) => { redirection = redirection = nock(URL + ':8080') .post(helper.generateCollectorPath('preconnect')) .reply(503) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -415,8 +397,6 @@ tap.test('receiving 503 response from preconnect', (t) => { helper.unloadAgent(agent) agent = null collectorApi = null - - done() }) t.test('should not have gotten an error', (t) => { @@ -453,7 +433,7 @@ tap.test('receiving no hostname from preconnect', (t) => { agent_run_id: RUN_ID } - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() collectorApi = new CollectorApi(agent) @@ -468,11 +448,9 @@ tap.test('receiving no hostname from preconnect', (t) => { connection = nock(URL + ':8080') .post(helper.generateCollectorPath('connect')) .reply(200, response) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -485,8 +463,6 @@ tap.test('receiving no hostname from preconnect', (t) => { helper.unloadAgent(agent) agent = null collectorApi = null - - done() }) t.test('should not error out', (t) => { @@ -537,7 +513,7 @@ tap.test('receiving a weirdo redirect name from preconnect', (t) => { agent_run_id: RUN_ID } - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() collectorApi = new CollectorApi(agent) @@ -557,11 +533,9 @@ tap.test('receiving a weirdo redirect name from preconnect', (t) => { connection = nock(URL + ':8080') .post(helper.generateCollectorPath('connect')) .reply(200, response) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -574,8 +548,6 @@ tap.test('receiving a weirdo redirect name from preconnect', (t) => { helper.unloadAgent(agent) agent = null collectorApi = null - - done() }) t.test('should not error out', (t) => { @@ -634,7 +606,7 @@ tap.test('receiving no config back from connect', (t) => { let connection = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() collectorApi = new CollectorApi(agent) @@ -647,11 +619,9 @@ tap.test('receiving no config back from connect', (t) => { connection = nock(URL) .post(helper.generateCollectorPath('connect')) .reply(200, {return_value: null}) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -664,8 +634,6 @@ tap.test('receiving no config back from connect', (t) => { helper.unloadAgent(agent) agent = null collectorApi = null - - done() }) t.test('should have gotten an error', (t) => { @@ -713,7 +681,7 @@ tap.test('receiving 503 response from connect', (t) => { let connection = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() collectorApi = new CollectorApi(agent) @@ -726,11 +694,9 @@ tap.test('receiving 503 response from connect', (t) => { connection = nock(URL) .post(helper.generateCollectorPath('connect')) .reply(503) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -743,8 +709,6 @@ tap.test('receiving 503 response from connect', (t) => { helper.unloadAgent(agent) agent = null collectorApi = null - - done() }) t.test('should not have gotten an error', (t) => { @@ -781,7 +745,7 @@ tap.test('receiving 200 response to connect but no data', (t) => { let connection = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() collectorApi = new CollectorApi(agent) @@ -794,11 +758,9 @@ tap.test('receiving 200 response to connect but no data', (t) => { connection = nock(URL) .post(helper.generateCollectorPath('connect')) .reply(200) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -811,8 +773,6 @@ tap.test('receiving 200 response to connect but no data', (t) => { helper.unloadAgent(agent) agent = null collectorApi = null - - done() }) t.test('should have gotten an error', (t) => { diff --git a/test/unit/error_events.test.js b/test/unit/error_events.test.js index ff7999fe3a..1ae3359a77 100644 --- a/test/unit/error_events.test.js +++ b/test/unit/error_events.test.js @@ -17,16 +17,12 @@ test('Error events', (t) => { t.test('when error events are disabled', (t) => { let agent - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - - done() }) t.test('collector can override', (t) => { @@ -43,16 +39,12 @@ test('Error events', (t) => { t.test('attributes', (t) => { let agent - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - - done() }) t.test('should include DT intrinsics', (t) => { @@ -147,17 +139,13 @@ test('Error events', (t) => { t.test('when error events are enabled', (t) => { let agent - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() agent.config.error_collector.capture_events = true - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - - done() }) t.test('collector can override', (t) => { diff --git a/test/unit/facts.test.js b/test/unit/facts.test.js index 07e936997f..8949139911 100644 --- a/test/unit/facts.test.js +++ b/test/unit/facts.test.js @@ -71,7 +71,7 @@ tap.test('fun facts about apps that New Relic is interested in include', (t) => let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { loggerMock.debug.reset() const config = { app_name: [...APP_NAMES] @@ -81,13 +81,11 @@ tap.test('fun facts about apps that New Relic is interested in include', (t) => agent.config.applications = () => { return config.app_name } - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) os.networkInterfaces = networkInterfaces - done() }) t.test("the current process ID as 'pid'", (t) => { @@ -265,7 +263,7 @@ tap.test('utilization', (t) => { let startingCommonRequest = null let startingCommonReadProc = null - t.beforeEach((done) => { + t.beforeEach(() => { startingEnv = {} Object.keys(process.env).forEach((key) => { startingEnv[key] = process.env[key] @@ -285,10 +283,9 @@ tap.test('utilization', (t) => { azureInfo.clearCache() gcpInfo.clearCache() kubernetesInfo.clearCache() - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (agent) { helper.unloadAgent(agent) } @@ -311,7 +308,6 @@ tap.test('utilization', (t) => { awsInfo.clearCache() azureInfo.clearCache() gcpInfo.clearCache() - done() }) utilTests.forEach((test) => { @@ -481,7 +477,7 @@ tap.test('boot_id', (t) => { let startingCommonReadProc = null let startingOsPlatform = null - t.beforeEach((done) => { + t.beforeEach(() => { startingGetMemory = sysInfo._getMemoryStats startingGetProcessor = sysInfo._getProcessorStats startingDockerInfo = sysInfo._getDockerContainerId @@ -489,10 +485,9 @@ tap.test('boot_id', (t) => { startingOsPlatform = os.platform os.platform = () => 'linux' - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (agent) { helper.unloadAgent(agent) } @@ -508,7 +503,6 @@ tap.test('boot_id', (t) => { startingDockerInfo = null startingCommonReadProc = null startingOsPlatform = null - done() }) bootIdTests.forEach((test) => { @@ -605,23 +599,19 @@ tap.test('display_host', {timeout: 20000}, (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent(DISABLE_ALL_DETECTIONS) agent.config.utilization = null os.hostname = () => { throw ('BROKEN') } - - done() }) - t.afterEach((done) => { + t.afterEach(() => { os.hostname = original_hostname helper.unloadAgent(agent) agent = null - - done() }) t.test('should be set to what the user specifies (happy path)', (t) => { diff --git a/test/unit/parsed-statement.test.js b/test/unit/parsed-statement.test.js index 0d1f27e5e3..629b8b8cd2 100644 --- a/test/unit/parsed-statement.test.js +++ b/test/unit/parsed-statement.test.js @@ -29,7 +29,7 @@ tap.test('recording database metrics', (t) => { t.test('on scoped transactions with parsed statements - with collection', (t) => { t.test('with collection', (t) => { - t.beforeEach((done) => { + t.beforeEach(() => { let ps = new ParsedStatement('NoSQL', 'select', 'test_collection') let transaction = new Transaction(agent) let segment = transaction.trace.add('test') @@ -40,8 +40,6 @@ tap.test('recording database metrics', (t) => { transaction.end() metrics = transaction.metrics - - done() }) t.test('should find 1 scoped metric', (t) => { @@ -93,7 +91,7 @@ tap.test('recording database metrics', (t) => { }) t.test('without collection', (t) => { - t.beforeEach((done) => { + t.beforeEach(() => { let ps = new ParsedStatement('NoSQL', 'select') let transaction = new Transaction(agent) let segment = transaction.trace.add('test') @@ -104,8 +102,6 @@ tap.test('recording database metrics', (t) => { transaction.end() metrics = transaction.metrics - - done() }) t.test('should find 1 scoped metric', (t) => { @@ -162,7 +158,7 @@ tap.test('recording database metrics', (t) => { t.test('on unscoped transactions with parsed statements', (t) => { t.test('with collection', (t) => { - t.beforeEach((done) => { + t.beforeEach(() => { let ps = new ParsedStatement('NoSQL', 'select', 'test_collection') let transaction = new Transaction(agent) let segment = transaction.trace.add('test') @@ -173,8 +169,6 @@ tap.test('recording database metrics', (t) => { transaction.end() metrics = transaction.metrics - - done() }) t.test('should find 0 unscoped metrics', (t) => { @@ -221,7 +215,7 @@ tap.test('recording database metrics', (t) => { }) t.test('without collection', (t) => { - t.beforeEach((done) => { + t.beforeEach(() => { let ps = new ParsedStatement('NoSQL', 'select') let transaction = new Transaction(agent) let segment = transaction.trace.add('test') @@ -232,8 +226,6 @@ tap.test('recording database metrics', (t) => { transaction.end() metrics = transaction.metrics - - done() }) t.test('should find 0 unscoped metrics', (t) => { @@ -291,7 +283,7 @@ tap.test('recording slow queries', (t) => { let segment let agent - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent({ slow_sql: {enabled: true}, transaction_tracer: { @@ -325,13 +317,10 @@ tap.test('recording slow queries', (t) => { ps2.recordMetrics(segment2, 'TEST') transaction.end() - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should update segment names', (t) => { @@ -369,7 +358,7 @@ tap.test('recording slow queries', (t) => { let segment let agent - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent({ slow_sql: {enabled: true}, transaction_tracer: { @@ -402,14 +391,11 @@ tap.test('recording slow queries', (t) => { ps2.recordMetrics(segment2, 'TEST') transaction.end() - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - done() }) t.test('should update segment names', (t) => { @@ -456,7 +442,7 @@ tap.test('recording slow queries', (t) => { let segment let agent - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent({ slow_sql: {enabled: true}, transaction_tracer: { @@ -479,13 +465,10 @@ tap.test('recording slow queries', (t) => { ps2.recordMetrics(segment2, 'TEST') transaction.end() - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should update segment names', (t) => { diff --git a/test/unit/prioritized-attributes.test.js b/test/unit/prioritized-attributes.test.js index b9b4c4d818..21521fcf66 100644 --- a/test/unit/prioritized-attributes.test.js +++ b/test/unit/prioritized-attributes.test.js @@ -19,14 +19,12 @@ tap.test('#addAttribute', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('adds an attribute to instance', (t) => { @@ -61,14 +59,12 @@ tap.test('#addAttribute - high priority', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should overwrite existing high priority attribute', (t) => { @@ -221,14 +217,12 @@ tap.test('#addAttribute - low priority', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should overwrite existing low priority attribute', (t) => { @@ -298,14 +292,12 @@ tap.test('#addAttributes', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('adds multiple attributes to instance', (t) => { @@ -394,14 +386,12 @@ tap.test('#get', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('gets attributes by destination, truncating values if necessary', (t) => { @@ -449,14 +439,12 @@ tap.test('#hasValidDestination', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should return true if single destination valid', (t) => { @@ -508,14 +496,12 @@ tap.test('#reset', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('resets instance attributes', (t) => { diff --git a/test/unit/protocols.test.js b/test/unit/protocols.test.js index 4738f812aa..7091d8fa87 100644 --- a/test/unit/protocols.test.js +++ b/test/unit/protocols.test.js @@ -13,19 +13,16 @@ const RemoteMethod = require('../../lib/collector/remote-method') tap.test('errors', (t) => { let agent - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() agent.config.attributes.enabled = true agent.config.run_id = 1 agent.errors.reconfigure(agent.config) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should serialize down to match the protocol', (t) => { diff --git a/test/unit/trace-segment.test.js b/test/unit/trace-segment.test.js index 4b821f690d..a7f99a09af 100644 --- a/test/unit/trace-segment.test.js +++ b/test/unit/trace-segment.test.js @@ -17,19 +17,17 @@ tap.test('TraceSegment', (t) => { t.autoend() let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { if (agent === null) { agent = helper.loadMockedAgent() } - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (agent) { helper.unloadAgent(agent) agent = null } - done() }) t.test('should be bound to a Trace', (t) => { @@ -209,7 +207,7 @@ tap.test('TraceSegment', (t) => { t.autoend() let webChild - t.beforeEach((done) => { + t.beforeEach(() => { agent.config.attributes.enabled = true agent.config.attributes.include.push('request.parameters.*') agent.config.emit('attributes.include') @@ -228,8 +226,6 @@ tap.test('TraceSegment', (t) => { webChild.setDurationInMillis(1, 0) trace.end() - - done() }) t.test('should return the URL minus any query parameters', (t) => { @@ -280,7 +276,7 @@ tap.test('TraceSegment', (t) => { t.autoend() let webChild, trace - t.beforeEach((done) => { + t.beforeEach(() => { agent.config.attributes.enabled = true const transaction = new Transaction(agent) @@ -309,7 +305,6 @@ tap.test('TraceSegment', (t) => { webChild.setDurationInMillis(1, 0) trace.end() - done() }) t.test('should return the URL minus any query parameters', (t) => { @@ -356,7 +351,7 @@ tap.test('TraceSegment', (t) => { t.autoend() let webChild - t.beforeEach((done) => { + t.beforeEach(() => { agent.config.attributes.enabled = false const transaction = new Transaction(agent) @@ -371,7 +366,6 @@ tap.test('TraceSegment', (t) => { trace.setDurationInMillis(1, 0) webChild.setDurationInMillis(1, 0) - done() }) t.test('should return the URL minus any query parameters', (t) => { @@ -402,7 +396,7 @@ tap.test('TraceSegment', (t) => { let webChild let attributes = null - t.beforeEach((done) => { + t.beforeEach(() => { agent.config.attributes.enabled = true agent.config.attributes.include = ['request.parameters.*'] agent.config.attributes.exclude = [ @@ -427,7 +421,6 @@ tap.test('TraceSegment', (t) => { attributes = webChild.getAttributes() trace.end() - done() }) t.test('should return the URL minus any query parameters', (t) => { @@ -557,21 +550,17 @@ tap.test('when serialized', (t) => { let trans = null let segment = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() trans = new Transaction(agent) segment = new TraceSegment(trans, 'UnitTest') - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null trans = null segment = null - - done() }) t.test('should create a plain JS array', (t) => { @@ -615,7 +604,7 @@ tap.test('getSpanContext', (t) => { let transaction = null let segment = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent({ distributed_tracing: { enabled: true @@ -623,15 +612,13 @@ tap.test('getSpanContext', (t) => { }) transaction = new Transaction(agent) segment = new TraceSegment(transaction, 'UnitTest') - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null transaction = null segment = null - done() }) t.test('should not initialize with a span context', (t) => { From 5306e79f56cdfca6257a3406c7b0a00bfd65f39e Mon Sep 17 00:00:00 2001 From: Bob Evans Date: Fri, 4 Jun 2021 11:52:16 -0400 Subject: [PATCH 03/13] removed remaining done in beforeEach and afterEach --- test/unit/collector/api.test.js | 64 ++--- test/unit/collector/remote-method.test.js | 44 +--- test/unit/collector/serverless.test.js | 70 +++--- test/unit/errors/error-collector.test.js | 8 +- test/unit/errors/ignore.test.js | 6 +- test/unit/instrumentation/core/domain.test.js | 8 +- .../unit/instrumentation/core/globals.test.js | 7 +- .../instrumentation/core/inspector.test.js | 6 +- .../instrumentation/core/promises.test.js | 8 +- test/unit/instrumentation/http/http.test.js | 92 +++---- .../http/no-parallel/queue-time.test.js | 7 +- .../instrumentation/http/outbound.test.js | 39 ++- .../instrumentation/http/synthetics.test.js | 28 ++- .../metrics-recorder/queue-time-http.test.js | 8 +- test/unit/serverless/aws-lambda.test.js | 8 +- test/unit/spans/span-event.test.js | 6 +- test/unit/spans/streaming-span-event.test.js | 116 +++++---- test/unit/trace.test.js | 224 ++++++++---------- test/unit/transaction.test.js | 32 +-- 19 files changed, 310 insertions(+), 471 deletions(-) diff --git a/test/unit/collector/api.test.js b/test/unit/collector/api.test.js index c99c97f12b..7439ef36ff 100644 --- a/test/unit/collector/api.test.js +++ b/test/unit/collector/api.test.js @@ -28,7 +28,7 @@ tap.test('reportSettings', (t) => { return_value: [] } - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() agent.config.run_id = RUN_ID collectorApi = new CollectorApi(agent) @@ -38,11 +38,9 @@ tap.test('reportSettings', (t) => { settings = nock(URL) .post(helper.generateCollectorPath('agent_settings', RUN_ID)) .reply(200, emptySettingsPayload) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -55,8 +53,6 @@ tap.test('reportSettings', (t) => { helper.unloadAgent(agent) agent = null collectorApi = null - - done() }) t.test('should not error out', (t) => { @@ -129,7 +125,7 @@ tap.test('error_data', (t) => { ] ] - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() agent.config.run_id = RUN_ID collectorApi = new CollectorApi(agent) @@ -141,11 +137,9 @@ tap.test('error_data', (t) => { errorDataEndpoint = nock(URL) .post(helper.generateCollectorPath('error_data', RUN_ID)) .reply(200, response) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -158,8 +152,6 @@ tap.test('error_data', (t) => { helper.unloadAgent(agent) agent = null collectorApi = null - - done() }) t.test('should not error out', (t) => { @@ -240,7 +232,7 @@ tap.test('sql_trace_data', (t) => { ] ] - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() agent.config.run_id = RUN_ID collectorApi = new CollectorApi(agent) @@ -252,11 +244,9 @@ tap.test('sql_trace_data', (t) => { sqlTraceEndpoint = nock(URL) .post(helper.generateCollectorPath('sql_trace_data', RUN_ID)) .reply(200, response) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -269,8 +259,6 @@ tap.test('sql_trace_data', (t) => { helper.unloadAgent(agent) agent = null collectorApi = null - - done() }) t.test('should not error out', (t) => { @@ -354,7 +342,7 @@ tap.test('analytic_event_data (transaction events)', (t) => { }] ] - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() agent.config.run_id = RUN_ID collectorApi = new CollectorApi(agent) @@ -366,11 +354,9 @@ tap.test('analytic_event_data (transaction events)', (t) => { analyticEventEndpoint = nock(URL) .post(helper.generateCollectorPath('analytic_event_data', RUN_ID)) .reply(200, response) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -383,8 +369,6 @@ tap.test('analytic_event_data (transaction events)', (t) => { helper.unloadAgent(agent) agent = null collectorApi = null - - done() }) t.test('should not error out', (t) => { @@ -464,7 +448,7 @@ tap.test('metric_data', (t) => { } } - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() agent.config.run_id = RUN_ID collectorApi = new CollectorApi(agent) @@ -476,11 +460,9 @@ tap.test('metric_data', (t) => { metricsEndpoint = nock(URL) .post(helper.generateCollectorPath('metric_data', RUN_ID)) .reply(200, response) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -493,8 +475,6 @@ tap.test('metric_data', (t) => { helper.unloadAgent(agent) agent = null collectorApi = null - - done() }) t.test('should not error out', (t) => { @@ -567,7 +547,7 @@ tap.test('transaction_sample_data (transaction trace)', (t) => { // imagine this is a serialized transaction trace const trace = [] - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() agent.config.run_id = RUN_ID collectorApi = new CollectorApi(agent) @@ -579,11 +559,9 @@ tap.test('transaction_sample_data (transaction trace)', (t) => { transactionTraceEndpoint = nock(URL) .post(helper.generateCollectorPath('transaction_sample_data', RUN_ID)) .reply(200, response) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -596,8 +574,6 @@ tap.test('transaction_sample_data (transaction trace)', (t) => { helper.unloadAgent(agent) agent = null collectorApi = null - - done() }) t.test('should not error out', (t) => { @@ -651,7 +627,7 @@ tap.test('shutdown', (t) => { let shutdownEndpoint = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() agent.config.run_id = RUN_ID collectorApi = new CollectorApi(agent) @@ -663,11 +639,9 @@ tap.test('shutdown', (t) => { shutdownEndpoint = nock(URL) .post(helper.generateCollectorPath('shutdown', RUN_ID)) .reply(200, response) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -680,8 +654,6 @@ tap.test('shutdown', (t) => { helper.unloadAgent(agent) agent = null collectorApi = null - - done() }) t.test('should not error out', (t) => { @@ -713,7 +685,7 @@ tap.test('shutdown', (t) => { let shutdownEndpoint = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = setupMockedAgent() agent.config.run_id = RUN_ID collectorApi = new CollectorApi(agent) @@ -723,11 +695,9 @@ tap.test('shutdown', (t) => { shutdownEndpoint = nock(URL) .post(helper.generateCollectorPath('shutdown', RUN_ID)) .reply(503) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -740,8 +710,6 @@ tap.test('shutdown', (t) => { helper.unloadAgent(agent) agent = null collectorApi = null - - done() }) t.test('should not error out', (t) => { diff --git a/test/unit/collector/remote-method.test.js b/test/unit/collector/remote-method.test.js index 1fbc24af3f..88ba55692d 100644 --- a/test/unit/collector/remote-method.test.js +++ b/test/unit/collector/remote-method.test.js @@ -51,9 +51,8 @@ tap.test('serialize', (t) => { let method = null - t.beforeEach((done) => { + t.beforeEach(() => { method = new RemoteMethod('test') - done() }) t.test('should JSON-encode the given payload', (t) => { @@ -95,7 +94,7 @@ tap.test('_safeRequest', (t) => { let method = null let options = null - t.beforeEach((done) => { + t.beforeEach(() => { method = new RemoteMethod('test', {max_payload_size_in_bytes: 100}, {}) options = { host: 'collector.newrelic.com', @@ -105,7 +104,6 @@ tap.test('_safeRequest', (t) => { body: [], path: '/nonexistent' } - done() }) t.test('requires an options hash', (t) => { @@ -238,7 +236,7 @@ tap.test('when posting to collector', (t) => { let config = null let method = null - t.beforeEach((done) => { + t.beforeEach(() => { // TODO: is this true? // order dependency: requiring nock at the top of the file breaks other tests nock = require('nock') @@ -256,15 +254,13 @@ tap.test('when posting to collector', (t) => { } method = new RemoteMethod('metric_data', config, endpoint) - done() }) - t.afterEach((done) => { + t.afterEach(() => { config = null method = null nock.cleanAll() nock.enableNetConnect() - done() }) t.test('should pass through error when compression fails', (t) => { @@ -387,18 +383,14 @@ tap.test('when posting to collector', (t) => { let thrown = null let originalSafeRequest = null - t.beforeEach((done) => { + t.beforeEach(() => { thrown = new Error('whoops!') originalSafeRequest = method._safeRequest method._safeRequest = () => {throw thrown} - - done() }) - t.afterEach((done) => { + t.afterEach(() => { method._safeRequest = originalSafeRequest - - done() }) t.test('should not allow the error to go uncaught', (t) => { @@ -416,7 +408,7 @@ tap.test('when posting to collector', (t) => { return_value: 'collector-42.newrelic.com' } - t.beforeEach((done) => { + t.beforeEach(() => { const successConfig = new Config({ ssl: true, license_key: 'license key here' @@ -432,8 +424,6 @@ tap.test('when posting to collector', (t) => { nock(URL) .post(generate('preconnect')) .reply(200, response) - - done() }) t.test('should not error', (t) => { @@ -458,12 +448,10 @@ tap.test('when posting to collector', (t) => { const response = {} - t.beforeEach((done) => { + t.beforeEach(() => { nock(URL) .post(generate('metric_data', RUN_ID)) .reply(409, response) - - done() }) t.test('should include status in callback response', (t) => { @@ -484,7 +472,7 @@ tap.test('when generating headers for a plain request', (t) => { let options = null let method = null - t.beforeEach((done) => { + t.beforeEach(() => { const config = new Config({ run_id: 12 }) @@ -503,7 +491,6 @@ tap.test('when generating headers for a plain request', (t) => { } headers = method._headers(options) - done() }) t.test('should use the content type from the parameter', (t) => { @@ -555,7 +542,7 @@ tap.test('when generating headers for a compressed request', (t) => { let headers = null - t.beforeEach((done) => { + t.beforeEach(() => { const config = new Config({ run_id: 12 }) @@ -574,7 +561,6 @@ tap.test('when generating headers for a compressed request', (t) => { } headers = method._headers(options) - done() }) t.test('should use the content type from the parameter', (t) => { @@ -622,7 +608,7 @@ tap.test('when generating a request URL', (t) => { return url.parse(generated, true, false) } - t.beforeEach((done) => { + t.beforeEach(() => { config = new Config({ license_key: TEST_LICENSE }) @@ -634,8 +620,6 @@ tap.test('when generating a request URL', (t) => { const method = new RemoteMethod(TEST_METHOD, config, endpoint) parsed = reconstitute(method._path()) - - done() }) t.test('should say that it supports protocol 17', (t) => { @@ -689,7 +673,7 @@ tap.test('when generating the User-Agent string', (t) => { let version = null let pkg = null - t.beforeEach((done) => { + t.beforeEach(() => { pkg = require('../../../package.json') version = pkg.version pkg.version = TEST_VERSION @@ -697,12 +681,10 @@ tap.test('when generating the User-Agent string', (t) => { const method = new RemoteMethod('test', config, {}) userAgent = method._userAgent() - done() }) - t.afterEach((done) => { + t.afterEach(() => { pkg.version = version - done() }) t.test('should clearly indicate it is New Relic for Node', (t) => { diff --git a/test/unit/collector/serverless.test.js b/test/unit/collector/serverless.test.js index 5415ed9d7a..10d997f0a2 100644 --- a/test/unit/collector/serverless.test.js +++ b/test/unit/collector/serverless.test.js @@ -7,12 +7,15 @@ const tap = require('tap') +const util = require('util') const zlib = require('zlib') const nock = require('nock') const chai = require('chai') const expect = chai.expect const sinon = require('sinon') const fs = require('fs') +const fsOpenAsync = util.promisify(fs.open) +const fsUnlinkAsync = util.promisify(fs.unlink) const helper = require('../../lib/agent_helper') const API = require('../../../lib/collector/serverless') const serverfulAPI = require('../../../lib/collector/api') @@ -24,7 +27,7 @@ tap.test('ServerlessCollector API', (t) => { let api = null let agent = null - function beforeTest(done) { + function beforeTest() { nock.disableNetConnect() agent = helper.loadMockedAgent({ serverless_mode: { @@ -36,15 +39,11 @@ tap.test('ServerlessCollector API', (t) => { agent.reconfigure = () => {} agent.setState = () => {} api = new API(agent) - - done() } - function afterTest(done) { + function afterTest() { nock.enableNetConnect() helper.unloadAgent(agent) - - done() } t.test('has all expected methods shared with the serverful API', (t) => { @@ -229,17 +228,17 @@ tap.test('ServerlessCollector API', (t) => { let stdOutSpy = null - t.beforeEach((done) => { + t.beforeEach(() => { // Need to allow output for tap to function correctly stdOutSpy = sinon.spy(process.stdout, 'write') - beforeTest(done) + beforeTest() }) - t.afterEach((done) => { + t.afterEach(() => { stdOutSpy.restore() - afterTest(done) + afterTest() }) t.test('compresses full payload and writes formatted to stdout', (t) => { @@ -292,50 +291,37 @@ tap.test('ServerlessCollector with output to custom pipe', (t) => { let agent = null let writeFileSyncStub = null - t.beforeEach((done) => { + t.beforeEach(async() => { nock.disableNetConnect() process.env.NEWRELIC_PIPE_PATH = customPath - fs.open(customPath, 'w', (err, fd) => { - if (err) { - throw err - } - - if (!fd) { - throw new Error('fd is null') - } - - agent = helper.loadMockedAgent({ - serverless_mode: { - enabled: true - }, - app_name: ['TEST'], - license_key: 'license key here', - NEWRELIC_PIPE_PATH: customPath - }) - agent.reconfigure = () => {} - agent.setState = () => {} - api = new API(agent) - - writeFileSyncStub = sinon.stub(fs, 'writeFileSync').callsFake(() => {}) + const fd = await fsOpenAsync(customPath, 'w') + if (!fd) { + throw new Error('fd is null') + } - done() + agent = helper.loadMockedAgent({ + serverless_mode: { + enabled: true + }, + app_name: ['TEST'], + license_key: 'license key here', + NEWRELIC_PIPE_PATH: customPath }) + agent.reconfigure = () => {} + agent.setState = () => {} + api = new API(agent) + + writeFileSyncStub = sinon.stub(fs, 'writeFileSync').callsFake(() => {}) }) - t.afterEach((done) => { + t.afterEach(async() => { nock.enableNetConnect() helper.unloadAgent(agent) writeFileSyncStub.restore() - fs.unlink(customPath, (err) => { - if (err) { - throw err - } - - done() - }) + await fsUnlinkAsync(customPath) }) t.test('compresses full payload and writes formatted to stdout', (t) => { diff --git a/test/unit/errors/error-collector.test.js b/test/unit/errors/error-collector.test.js index 5b99ea12c6..c84d4181f7 100644 --- a/test/unit/errors/error-collector.test.js +++ b/test/unit/errors/error-collector.test.js @@ -1779,18 +1779,16 @@ test('When using the async listener', (t) => { let active = null let json = null - t.beforeEach((done, t) => { + t.beforeEach((t) => { agent = helper.instrumentMockedAgent() // Once on node 10+ only, may be able to replace with below. // t.expectUncaughtException(fn, [expectedError], message, extra) // https://node-tap.org/docs/api/asserts/#texpectuncaughtexceptionfn-expectederror-message-extra helper.temporarilyOverrideTapUncaughtBehavior(tap, t) - - done() }) - t.afterEach(function(done) { + t.afterEach(function() { transaction.end() helper.unloadAgent(agent) @@ -1798,8 +1796,6 @@ test('When using the async listener', (t) => { transaction = null active = null json = null - - done() }) t.test('should not have a domain active', (t) => { diff --git a/test/unit/errors/ignore.test.js b/test/unit/errors/ignore.test.js index 6df4f8ba08..684849cbe0 100644 --- a/test/unit/errors/ignore.test.js +++ b/test/unit/errors/ignore.test.js @@ -15,14 +15,12 @@ tap.test('Ignored Errors', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('Ignore Classes should result in no error reported', (t) => { diff --git a/test/unit/instrumentation/core/domain.test.js b/test/unit/instrumentation/core/domain.test.js index 42557c88b9..c4cef2657d 100644 --- a/test/unit/instrumentation/core/domain.test.js +++ b/test/unit/instrumentation/core/domain.test.js @@ -18,7 +18,7 @@ test('Domains', (t) => { let tasks = [] let interval = null - t.beforeEach((done, t) => { + t.beforeEach((t) => { // Once on node 10+ only, may be able to replace with below. // t.expectUncaughtException(fn, [expectedError], message, extra) // https://node-tap.org/docs/api/asserts/#texpectuncaughtexceptionfn-expectederror-message-extra @@ -33,17 +33,13 @@ test('Domains', (t) => { while (tasks.length) { tasks.pop()() } - - done() }, 10) }) - t.afterEach((done) => { + t.afterEach(() => { d && d.exit() clearInterval(interval) helper.unloadAgent(agent) - - done() }) t.test('should not be loaded just from loading the agent', (t) => { diff --git a/test/unit/instrumentation/core/globals.test.js b/test/unit/instrumentation/core/globals.test.js index b63ed37381..e2d1052f08 100644 --- a/test/unit/instrumentation/core/globals.test.js +++ b/test/unit/instrumentation/core/globals.test.js @@ -19,20 +19,17 @@ test('Unhandled rejection', (t) => { let agent = null - t.beforeEach((done, t) => { + t.beforeEach((t) => { // Once on node 10+ only, may be able to replace with below. // t.expectUncaughtException(fn, [expectedError], message, extra) // https://node-tap.org/docs/api/asserts/#texpectuncaughtexceptionfn-expectederror-message-extra helper.temporarilyOverrideTapUncaughtBehavior(tap, t) agent = helper.instrumentMockedAgent() - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should not report it if there is another handler', (t) => { diff --git a/test/unit/instrumentation/core/inspector.test.js b/test/unit/instrumentation/core/inspector.test.js index 48667f4865..25f087d667 100644 --- a/test/unit/instrumentation/core/inspector.test.js +++ b/test/unit/instrumentation/core/inspector.test.js @@ -12,14 +12,12 @@ const inspectorInstrumentation = require('../../../../lib/instrumentation/core/i tap.test('Inspector instrumentation', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should not throw when passed null for the module', (t) => { diff --git a/test/unit/instrumentation/core/promises.test.js b/test/unit/instrumentation/core/promises.test.js index 263de8a1d1..af0d775075 100644 --- a/test/unit/instrumentation/core/promises.test.js +++ b/test/unit/instrumentation/core/promises.test.js @@ -15,22 +15,18 @@ test('Promise trace', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent({ feature_flag: { promise_segments: true, await_support: false } }) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - - done() }) t.test('should handle straight chains', (t) => { diff --git a/test/unit/instrumentation/http/http.test.js b/test/unit/instrumentation/http/http.test.js index e8af4cb39d..8946ebc4ed 100644 --- a/test/unit/instrumentation/http/http.test.js +++ b/test/unit/instrumentation/http/http.test.js @@ -37,16 +37,13 @@ test('built-in http module instrumentation', (t) => { let initialize - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() initialize = require('../../../../lib/instrumentation/core/http') - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('when passed no module', (t) => { @@ -65,14 +62,12 @@ test('built-in http module instrumentation', (t) => { t.test('after loading', (t) => { t.autoend() - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent() - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should not have changed createServer\'s declared parameter names', (t) => { @@ -92,7 +87,7 @@ test('built-in http module instrumentation', (t) => { let options - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() const initialize = require('../../../../lib/instrumentation/core/http') http = { @@ -108,14 +103,10 @@ test('built-in http module instrumentation', (t) => { } initialize(agent, http, 'http', new Shim(agent, 'http')) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - - done() }) t.test('should not crash when called with undefined host', (t) => { @@ -144,7 +135,7 @@ test('built-in http module instrumentation', (t) => { let server = null let external = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent() http = require('http') @@ -196,22 +187,22 @@ test('built-in http module instrumentation', (t) => { hookCalled = true } - external.listen(8321, 'localhost', function() { - server.listen(8123, 'localhost', function() { - // The transaction doesn't get created until after the instrumented - // server handler fires. - t.notOk(agent.getTransaction()) - done() + return new Promise((resolve) => { + external.listen(8321, 'localhost', function() { + server.listen(8123, 'localhost', function() { + // The transaction doesn't get created until after the instrumented + // server handler fires. + t.notOk(agent.getTransaction()) + resolve() + }) }) }) }) - t.afterEach((done) => { + t.afterEach(() => { external.close() server.close() helper.unloadAgent(agent) - - done() }) function makeRequest(params, cb) { @@ -292,6 +283,8 @@ test('built-in http module instrumentation', (t) => { const segment = transaction.baseSegment const spanAttributes = segment.attributes.get(DESTINATIONS.SPAN_EVENT) + // TODO: these attrs aren't getting filtered + // not familiar with code so trying to trace where this is supposed to be removed t.notOk(attributes['request.headers.x-filtered-out']) t.notOk(attributes['request.headers.xFilteredOut']) t.match(attributes, { @@ -325,7 +318,7 @@ test('built-in http module instrumentation', (t) => { 'User-Agent': userAgent } }, finish) - + function finish(err, statusCode, body) { const attributes = transaction.trace.attributes.get(DESTINATIONS.TRANS_TRACE) const segment = transaction.baseSegment @@ -377,18 +370,15 @@ test('built-in http module instrumentation', (t) => { const encKey = 'gringletoes' let agent2 - t.beforeEach((done) => { + t.beforeEach(() => { agent2 = helper.instrumentMockedAgent({ cross_application_tracer: {enabled: true}, encoding_key: encKey }) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent2) - done() }) t.test('should add cat headers from request to transaction', (t) => { @@ -436,7 +426,7 @@ test('built-in http module instrumentation', (t) => { req.socket.end() server.close(t.end()) }) - + const transactionHeader = [ '789', false, @@ -448,12 +438,12 @@ test('built-in http module instrumentation', (t) => { JSON.stringify(transactionHeader), encKey ) - + server.on('listening', function() { const port = server.address().port http.get({host: 'localhost', port: port, headers: headers}) }) - + helper.startServerWithRandomPortRetry(server) }) @@ -484,17 +474,15 @@ test('built-in http module instrumentation', (t) => { t.test('inbound http requests when cat is disabled', (t) => { const encKey = 'gringletoes' - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent({ cross_application_tracer: {enabled: false}, encoding_key: encKey }) - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should ignore cat headers', (t) => { @@ -539,19 +527,17 @@ test('built-in http module instrumentation', (t) => { t.test('response headers for inbound requests when cat is enabled', (t) => { const encKey = 'gringletoes' - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent({ cross_application_tracer: {enabled: true}, encoding_key: encKey, trusted_account_ids: [123], cross_process_id: '456' }) - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should set header correctly when all data is present', (t) => { @@ -660,7 +646,7 @@ test('built-in http module instrumentation', (t) => { t.test('Should accept w3c traceparent header when present on request', (t) => { - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent({ distributed_tracing: { enabled: true @@ -668,12 +654,10 @@ test('built-in http module instrumentation', (t) => { feature_flag: { } }) - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should set header correctly when all data is present', (t) => { @@ -781,7 +765,7 @@ test('built-in http module instrumentation', (t) => { const encKey = 'gringletoes' let server - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent({ cross_application_tracer: {enabled: true}, encoding_key: encKey, @@ -793,14 +777,16 @@ test('built-in http module instrumentation', (t) => { req.resume() }) - helper.randomPort((port) => { - server.listen(port, done) + return new Promise((resolve) => { + helper.randomPort((port) => { + server.listen(port, resolve) + }) }) }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - server.close(done) + server.close() }) function addSegment() { @@ -1047,9 +1033,7 @@ test('http.createServer should trace errors in top-level handlers', (t) => { // abort request to close connection and // allow server to close fast instead of after timeout request.abort() - server.close(() => { - t.end() - }) + server.close(t.end) }) server = http.createServer(function cb_createServer() { diff --git a/test/unit/instrumentation/http/no-parallel/queue-time.test.js b/test/unit/instrumentation/http/no-parallel/queue-time.test.js index 6aafd8face..87e772e171 100644 --- a/test/unit/instrumentation/http/no-parallel/queue-time.test.js +++ b/test/unit/instrumentation/http/no-parallel/queue-time.test.js @@ -21,19 +21,16 @@ tap.test('built-in http queueTime', (t) => { let PORT = null let THRESHOLD = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent() testDate = Date.now() PORT = 0 THRESHOLD = 200 - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('header should allow t=${time} style headers', (t) => { diff --git a/test/unit/instrumentation/http/outbound.test.js b/test/unit/instrumentation/http/outbound.test.js index c4334c023d..5c6548dc4f 100644 --- a/test/unit/instrumentation/http/outbound.test.js +++ b/test/unit/instrumentation/http/outbound.test.js @@ -26,14 +26,12 @@ tap.test('instrumentOutbound', (t) => { const PORT = 8890 - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should omit query parameters from path if attributes.enabled is false', (t) => { @@ -119,7 +117,7 @@ tap.test('instrumentOutbound', (t) => { t.test('should not accept an undefined path', (t) => { const req = new events.EventEmitter() helper.runInTransaction(agent, function() { - t.throws(() => + t.throws(() => instrumentOutbound(agent, {host: HOSTNAME, port: PORT}, makeFakeRequest), Error) }) @@ -258,7 +256,7 @@ tap.test('should add data from cat header to segment', (t) => { 'xyz' ] - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent({ cross_application_tracer: {enabled: true}, encoding_key: encKey, @@ -271,14 +269,18 @@ tap.test('should add data from cat header to segment', (t) => { req.resume() }) - helper.randomPort((port) => { - server.listen(port, done) + return new Promise((resolve) => { + helper.randomPort((port) => { + server.listen(port, resolve) + }) }) }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - server.close(done) + return new Promise((resolve) => { + server.close(resolve) + }) }) function addSegment() { @@ -341,9 +343,8 @@ tap.test('should add data from cat header to segment', (t) => { return emit.apply(this, arguments) } - t.afterEach((done) => { + t.afterEach(() => { events.EventEmitter.prototype.emit = emit - done() }) helper.runInTransaction(agent, handled) @@ -383,16 +384,14 @@ tap.test('should add data from cat header to segment', (t) => { tap.test('when working with http.request', (t) => { let agent - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent() nock.disableNetConnect() - done() }) - t.afterEach((done) => { + t.afterEach(() => { nock.enableNetConnect() helper.unloadAgent(agent) - done() }) t.test('should accept port and hostname', (t) => { @@ -574,18 +573,14 @@ tap.test('Should properly handle http(s) get and request signatures', (t) => { let agent = null - function beforeTest(cb) { + function beforeTest() { agent = helper.instrumentMockedAgent() nock.disableNetConnect() - - cb() } - function afterTest(cb) { + function afterTest() { nock.enableNetConnect() helper.unloadAgent(agent) - - cb() } t.test('http.get', (t) => { diff --git a/test/unit/instrumentation/http/synthetics.test.js b/test/unit/instrumentation/http/synthetics.test.js index bd784b875b..f96d43c7a9 100644 --- a/test/unit/instrumentation/http/synthetics.test.js +++ b/test/unit/instrumentation/http/synthetics.test.js @@ -40,7 +40,7 @@ tap.test('synthetics outbound header', (t) => { port: PORT } - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent({ cross_application_tracer: {enabled: true}, trusted_account_ids: [23, 567], @@ -51,13 +51,16 @@ tap.test('synthetics outbound header', (t) => { req.resume() res.end() }) - server.listen(PORT, done) + + return new Promise((resolve) => { + server.listen(PORT, resolve) + }) }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - server.close(function() { - done() + return new Promise((resolve) => { + server.close(resolve) }) }) @@ -103,18 +106,18 @@ tap.test('should add synthetics inbound header to transaction', (t) => { port: PORT } - function createServer(done, requestHandler) { + function createServer(cb, requestHandler) { http = require('http') const s = http.createServer(function(req, res) { requestHandler(req, res) res.end() req.resume() }) - s.listen(PORT, done) + s.listen(PORT, cb) return s } - t.beforeEach((done) => { + t.beforeEach(() => { synthData = [ 1, // version 567, // account id @@ -129,12 +132,13 @@ tap.test('should add synthetics inbound header to transaction', (t) => { }) http = require('http') - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - server.close(done) + return new Promise((resolve) => { + server.close(resolve) + }) }) t.test('should exist if account id and version are ok', (t) => { @@ -188,7 +192,7 @@ tap.test('should add synthetics inbound header to transaction', (t) => { }, function onRequest(req, res) { res.writeHead(200) - t.match(res._headers, { + t.match(res.getHeaders(), { 'x-newrelic-synthetics': synthHeader }) t.end() diff --git a/test/unit/metrics-recorder/queue-time-http.test.js b/test/unit/metrics-recorder/queue-time-http.test.js index c25fc34dfb..06d8f03654 100644 --- a/test/unit/metrics-recorder/queue-time-http.test.js +++ b/test/unit/metrics-recorder/queue-time-http.test.js @@ -38,17 +38,13 @@ tap.test("when recording queueTime", (test) => { let agent let trans - test.beforeEach((done) => { + test.beforeEach(() => { agent = helper.instrumentMockedAgent() trans = new Transaction(agent) - - done() }) - test.afterEach((done) => { + test.afterEach(() => { helper.unloadAgent(agent) - - done() }) test.test("non zero times should record a metric", (t) => { diff --git a/test/unit/serverless/aws-lambda.test.js b/test/unit/serverless/aws-lambda.test.js index 7669e43a94..6fc9bc2114 100644 --- a/test/unit/serverless/aws-lambda.test.js +++ b/test/unit/serverless/aws-lambda.test.js @@ -1259,7 +1259,7 @@ test('AwsLambda.patchLambdaHandler', (t) => { let error - function beforeTest(cb) { + function beforeTest() { agent = helper.loadMockedAgent({ allow_all_headers: true, attributes: { @@ -1293,11 +1293,9 @@ test('AwsLambda.patchLambdaHandler', (t) => { error = new SyntaxError(errorMessage) agent.setState('started') - - cb() } - function afterTest(cb) { + function afterTest() { stubEvent = null stubContext = null stubCallback = null @@ -1314,8 +1312,6 @@ test('AwsLambda.patchLambdaHandler', (t) => { agent = null awsLambda = null - - cb() } t.test('when invoked with a non web event', (t) => { diff --git a/test/unit/spans/span-event.test.js b/test/unit/spans/span-event.test.js index 0ef206c766..c8d315de22 100644 --- a/test/unit/spans/span-event.test.js +++ b/test/unit/spans/span-event.test.js @@ -47,18 +47,16 @@ tap.test('fromSegment()', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent({ distributed_tracing: { enabled: true } }) - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should create a generic span with a random segment', (t) => { diff --git a/test/unit/spans/streaming-span-event.test.js b/test/unit/spans/streaming-span-event.test.js index 9d267b2f51..b18c97d8a9 100644 --- a/test/unit/spans/streaming-span-event.test.js +++ b/test/unit/spans/streaming-span-event.test.js @@ -28,11 +28,11 @@ tap.test('#constructor() should construct an empty span event', (t) => { t.ok(span) t.ok(span instanceof StreamingSpanEvent) - t.deepEqual(span._agentAttributes, attrs) + t.same(span._agentAttributes, attrs) t.ok(span._intrinsicAttributes) - t.deepEqual(span._intrinsicAttributes.type, {[STRING_TYPE]: 'Span'}) - t.deepEqual(span._intrinsicAttributes.category, {[STRING_TYPE]: CATEGORIES.GENERIC}) + t.same(span._intrinsicAttributes.type, {[STRING_TYPE]: 'Span'}) + t.same(span._intrinsicAttributes.category, {[STRING_TYPE]: CATEGORIES.GENERIC}) t.end() }) @@ -42,18 +42,16 @@ tap.test('fromSegment()', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent({ distributed_tracing: { enabled: true } }) - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should create a generic span with a random segment', (t) => { @@ -73,17 +71,17 @@ tap.test('fromSegment()', (t) => { t.ok(span instanceof StreamingSpanEvent) t.ok(span._intrinsicAttributes) - t.deepEqual(span._intrinsicAttributes.type, {[STRING_TYPE]: 'Span'}) - t.deepEqual(span._intrinsicAttributes.category, {[STRING_TYPE]: CATEGORIES.GENERIC}) - - t.deepEqual(span._intrinsicAttributes.traceId, {[STRING_TYPE]: transaction.traceId}) - t.deepEqual(span._intrinsicAttributes.guid, {[STRING_TYPE]: segment.id}) - t.deepEqual(span._intrinsicAttributes.parentId, {[STRING_TYPE]: 'parent'}) - t.deepEqual(span._intrinsicAttributes.transactionId, {[STRING_TYPE]: transaction.id}) - t.deepEqual(span._intrinsicAttributes.sampled, {[BOOL_TYPE]: true}) - t.deepEqual(span._intrinsicAttributes.priority, {[INT_TYPE]: 42}) - t.deepEqual(span._intrinsicAttributes.name, {[STRING_TYPE]: 'timers.setTimeout'}) - t.deepEqual(span._intrinsicAttributes.timestamp, {[INT_TYPE]: segment.timer.start}) + t.same(span._intrinsicAttributes.type, {[STRING_TYPE]: 'Span'}) + t.same(span._intrinsicAttributes.category, {[STRING_TYPE]: CATEGORIES.GENERIC}) + + t.same(span._intrinsicAttributes.traceId, {[STRING_TYPE]: transaction.traceId}) + t.same(span._intrinsicAttributes.guid, {[STRING_TYPE]: segment.id}) + t.same(span._intrinsicAttributes.parentId, {[STRING_TYPE]: 'parent'}) + t.same(span._intrinsicAttributes.transactionId, {[STRING_TYPE]: transaction.id}) + t.same(span._intrinsicAttributes.sampled, {[BOOL_TYPE]: true}) + t.same(span._intrinsicAttributes.priority, {[INT_TYPE]: 42}) + t.same(span._intrinsicAttributes.name, {[STRING_TYPE]: 'timers.setTimeout'}) + t.same(span._intrinsicAttributes.timestamp, {[INT_TYPE]: segment.timer.start}) t.ok(span._intrinsicAttributes.duration) t.ok(span._intrinsicAttributes.duration[DOUBLE_TYPE]) @@ -95,7 +93,7 @@ tap.test('fromSegment()', (t) => { const customAttributes = span._customAttributes t.ok(customAttributes) - t.deepEqual(customAttributes['Span Lee'], {[STRING_TYPE]: 'no prize'}) + t.same(customAttributes['Span Lee'], {[STRING_TYPE]: 'no prize'}) const agentAttributes = span._agentAttributes t.ok(agentAttributes) @@ -134,34 +132,34 @@ tap.test('fromSegment()', (t) => { t.ok(span instanceof StreamingSpanEvent) t.ok(span._intrinsicAttributes) - t.deepEqual(span._intrinsicAttributes.type, {[STRING_TYPE]: 'Span'}) - t.deepEqual(span._intrinsicAttributes.category, {[STRING_TYPE]: CATEGORIES.HTTP}) + t.same(span._intrinsicAttributes.type, {[STRING_TYPE]: 'Span'}) + t.same(span._intrinsicAttributes.category, {[STRING_TYPE]: CATEGORIES.HTTP}) - t.deepEqual(span._intrinsicAttributes.traceId, {[STRING_TYPE]: transaction.traceId}) - t.deepEqual(span._intrinsicAttributes.guid, {[STRING_TYPE]: segment.id}) - t.deepEqual(span._intrinsicAttributes.parentId, {[STRING_TYPE]: 'parent'}) - t.deepEqual(span._intrinsicAttributes.transactionId, {[STRING_TYPE]: transaction.id}) - t.deepEqual(span._intrinsicAttributes.sampled, {[BOOL_TYPE]: true}) - t.deepEqual(span._intrinsicAttributes.priority, {[INT_TYPE]: 42}) + t.same(span._intrinsicAttributes.traceId, {[STRING_TYPE]: transaction.traceId}) + t.same(span._intrinsicAttributes.guid, {[STRING_TYPE]: segment.id}) + t.same(span._intrinsicAttributes.parentId, {[STRING_TYPE]: 'parent'}) + t.same(span._intrinsicAttributes.transactionId, {[STRING_TYPE]: transaction.id}) + t.same(span._intrinsicAttributes.sampled, {[BOOL_TYPE]: true}) + t.same(span._intrinsicAttributes.priority, {[INT_TYPE]: 42}) - t.deepEqual(span._intrinsicAttributes.name, {[STRING_TYPE]: 'External/example.com:443/'}) - t.deepEqual(span._intrinsicAttributes.timestamp, {[INT_TYPE]: segment.timer.start}) + t.same(span._intrinsicAttributes.name, {[STRING_TYPE]: 'External/example.com:443/'}) + t.same(span._intrinsicAttributes.timestamp, {[INT_TYPE]: segment.timer.start}) t.ok(span._intrinsicAttributes.duration) t.ok(span._intrinsicAttributes.duration[DOUBLE_TYPE]) // Should have type-specific intrinsics - t.deepEqual(span._intrinsicAttributes.component, {[STRING_TYPE]: 'http'}) - t.deepEqual(span._intrinsicAttributes['span.kind'], {[STRING_TYPE]: 'client'}) + t.same(span._intrinsicAttributes.component, {[STRING_TYPE]: 'http'}) + t.same(span._intrinsicAttributes['span.kind'], {[STRING_TYPE]: 'client'}) const agentAttributes = span._agentAttributes t.ok(agentAttributes) // Should have (most) http properties. - t.deepEqual(agentAttributes['http.url'], {[STRING_TYPE]: 'https://example.com:443/'}) + t.same(agentAttributes['http.url'], {[STRING_TYPE]: 'https://example.com:443/'}) t.ok(agentAttributes['http.method']) - t.deepEqual(agentAttributes['http.statusCode'], {[INT_TYPE]: 200}) - t.deepEqual(agentAttributes['http.statusText'], {[STRING_TYPE]: 'OK'}) + t.same(agentAttributes['http.statusCode'], {[INT_TYPE]: 200}) + t.same(agentAttributes['http.statusText'], {[STRING_TYPE]: 'OK'}) // Should have no datastore properties. const hasOwnAttribute = Object.hasOwnProperty.bind(agentAttributes) @@ -219,29 +217,29 @@ tap.test('fromSegment()', (t) => { t.ok(span instanceof StreamingSpanEvent) t.ok(span._intrinsicAttributes) - t.deepEqual(span._intrinsicAttributes.type, {[STRING_TYPE]: 'Span'}) - t.deepEqual(span._intrinsicAttributes.category, {[STRING_TYPE]: CATEGORIES.DATASTORE}) + t.same(span._intrinsicAttributes.type, {[STRING_TYPE]: 'Span'}) + t.same(span._intrinsicAttributes.category, {[STRING_TYPE]: CATEGORIES.DATASTORE}) - t.deepEqual(span._intrinsicAttributes.traceId, {[STRING_TYPE]: transaction.traceId}) - t.deepEqual(span._intrinsicAttributes.guid, {[STRING_TYPE]: segment.id}) - t.deepEqual(span._intrinsicAttributes.parentId, {[STRING_TYPE]: 'parent'}) - t.deepEqual(span._intrinsicAttributes.transactionId, {[STRING_TYPE]: transaction.id}) - t.deepEqual(span._intrinsicAttributes.sampled, {[BOOL_TYPE]: true}) - t.deepEqual(span._intrinsicAttributes.priority, {[INT_TYPE]: 42}) + t.same(span._intrinsicAttributes.traceId, {[STRING_TYPE]: transaction.traceId}) + t.same(span._intrinsicAttributes.guid, {[STRING_TYPE]: segment.id}) + t.same(span._intrinsicAttributes.parentId, {[STRING_TYPE]: 'parent'}) + t.same(span._intrinsicAttributes.transactionId, {[STRING_TYPE]: transaction.id}) + t.same(span._intrinsicAttributes.sampled, {[BOOL_TYPE]: true}) + t.same(span._intrinsicAttributes.priority, {[INT_TYPE]: 42}) - t.deepEqual( + t.same( span._intrinsicAttributes.name, {[STRING_TYPE]: 'Datastore/statement/TestStore/test/test'} ) - t.deepEqual(span._intrinsicAttributes.timestamp, {[INT_TYPE]: segment.timer.start}) + t.same(span._intrinsicAttributes.timestamp, {[INT_TYPE]: segment.timer.start}) t.ok(span._intrinsicAttributes.duration) t.ok(span._intrinsicAttributes.duration[DOUBLE_TYPE]) // Should have (most) type-specific intrinsics - t.deepEqual(span._intrinsicAttributes.component, {[STRING_TYPE]: 'TestStore'}) - t.deepEqual(span._intrinsicAttributes['span.kind'], {[STRING_TYPE]: 'client'}) + t.same(span._intrinsicAttributes.component, {[STRING_TYPE]: 'TestStore'}) + t.same(span._intrinsicAttributes['span.kind'], {[STRING_TYPE]: 'client'}) const agentAttributes = span._agentAttributes t.ok(agentAttributes) @@ -253,9 +251,9 @@ tap.test('fromSegment()', (t) => { // Should have (most) datastore properties. t.ok(agentAttributes['db.instance']) - t.deepEqual(agentAttributes['db.collection'], {[STRING_TYPE]: 'my-collection'}) - t.deepEqual(agentAttributes['peer.hostname'], {[STRING_TYPE]: 'my-db-host'}) - t.deepEqual(agentAttributes['peer.address'], {[STRING_TYPE]: 'my-db-host:/path/to/db.sock'}) + t.same(agentAttributes['db.collection'], {[STRING_TYPE]: 'my-collection'}) + t.same(agentAttributes['peer.hostname'], {[STRING_TYPE]: 'my-db-host'}) + t.same(agentAttributes['peer.address'], {[STRING_TYPE]: 'my-db-host:/path/to/db.sock'}) const statement = agentAttributes['db.statement'] t.ok(statement) @@ -296,12 +294,12 @@ tap.test('fromSegment()', (t) => { t.equal(traceId, transaction.traceId) // Spot check a few known attributes - t.deepEqual(intrinsics.type, {[STRING_TYPE]: 'Span'}) - t.deepEqual(intrinsics.traceId, {[STRING_TYPE]: transaction.traceId}) + t.same(intrinsics.type, {[STRING_TYPE]: 'Span'}) + t.same(intrinsics.traceId, {[STRING_TYPE]: transaction.traceId}) - t.deepEqual(userAttributes.customKey, {[STRING_TYPE]: 'customValue'}) + t.same(userAttributes.customKey, {[STRING_TYPE]: 'customValue'}) - t.deepEqual(agentAttributes.anAgentAttribute, {[BOOL_TYPE]: true}) + t.same(agentAttributes.anAgentAttribute, {[BOOL_TYPE]: true}) t.end() }, 10) @@ -324,8 +322,8 @@ tap.test('fromSegment()', (t) => { const serializedSpan = span.toStreamingFormat() const {intrinsics} = serializedSpan - t.deepEqual(intrinsics['intrinsic.1'], {[INT_TYPE]: 1}) - t.deepEqual(intrinsics['intrinsic.2'], {[INT_TYPE]: 2}) + t.same(intrinsics['intrinsic.1'], {[INT_TYPE]: 1}) + t.same(intrinsics['intrinsic.2'], {[INT_TYPE]: 2}) t.end() }, 10) @@ -347,8 +345,8 @@ tap.test('fromSegment()', (t) => { t.ok(span instanceof StreamingSpanEvent) t.ok(span._intrinsicAttributes) - t.deepEqual(span._intrinsicAttributes.category, {[STRING_TYPE]: CATEGORIES.HTTP}) - t.deepEqual(span._intrinsicAttributes['span.kind'], {[STRING_TYPE]: 'client'}) + t.same(span._intrinsicAttributes.category, {[STRING_TYPE]: CATEGORIES.HTTP}) + t.same(span._intrinsicAttributes['span.kind'], {[STRING_TYPE]: 'client'}) t.end() }) @@ -368,8 +366,8 @@ tap.test('fromSegment()', (t) => { t.ok(span instanceof StreamingSpanEvent) - t.deepEqual(span._intrinsicAttributes.category, {[STRING_TYPE]: CATEGORIES.DATASTORE}) - t.deepEqual(span._intrinsicAttributes['span.kind'], {[STRING_TYPE]: 'client'}) + t.same(span._intrinsicAttributes.category, {[STRING_TYPE]: CATEGORIES.DATASTORE}) + t.same(span._intrinsicAttributes['span.kind'], {[STRING_TYPE]: 'client'}) t.end() }) diff --git a/test/unit/trace.test.js b/test/unit/trace.test.js index 9601bae3a2..0851b34428 100644 --- a/test/unit/trace.test.js +++ b/test/unit/trace.test.js @@ -10,12 +10,15 @@ const tap = require('tap') // Below allows use of mocha DSL with tap runner. tap.mochaGlobals() +const util = require('util') const sinon = require('sinon') const chai = require('chai') const DESTINATIONS = require('../../lib/config/attribute-filter').DESTINATIONS const expect = chai.expect const helper = require('../lib/agent_helper') const codec = require('../../lib/util/codec') +const codecEncodeAsync = util.promisify(codec.encode) +const codecDecodeAsync = util.promisify(codec.decode) const Segment = require('../../lib/transaction/trace/segment') const DTPayload = require('../../lib/transaction/dt-payload') const Trace = require('../../lib/transaction/trace') @@ -59,30 +62,20 @@ describe('Trace', function() { }) describe('when serializing synchronously', () => { - var details + let details - beforeEach(function(done) { - makeTrace(agent, function(err, _details) { - details = _details - done(err) - }) + beforeEach(async() => { + details = await makeTrace(agent) }) - it('should produce a transaction trace in the expected format', function(done) { + it('should produce a transaction trace in the expected format', async function() { const traceJSON = details.trace.generateJSONSync() - codec.decode(traceJSON[4], function(derr, reconstituted) { - if (derr) { - return done(derr) - } - - expect(traceJSON, 'full trace JSON') - .to.deep.equal(details.expectedEncoding) - - expect(reconstituted, 'reconstituted trace segments') - .to.deep.equal(details.rootNode) + const reconstituted = await codecDecodeAsync(traceJSON[4]) + expect(traceJSON, 'full trace JSON') + .to.deep.equal(details.expectedEncoding) - return done() - }) + expect(reconstituted, 'reconstituted trace segments') + .to.deep.equal(details.rootNode) }) it('should send response time', function() { @@ -95,20 +88,14 @@ describe('Trace', function() { }) describe('when `simple_compression` is `false`', function() { - it('should compress the segment arrays', function(done) { + it('should compress the segment arrays', async function() { const json = details.trace.generateJSONSync() expect(json[4]) .to.match(/^[a-zA-Z0-9\+\/]+={0,2}$/, 'should be base64 encoded') - codec.decode(json[4], function(err, data) { - if (err) { - return done(err) - } - - expect(data).to.deep.equal(details.rootNode) - done() - }) + const data = await codecDecodeAsync(json[4]) + expect(data).to.deep.equal(details.rootNode) }) }) @@ -125,69 +112,52 @@ describe('Trace', function() { }) describe('when serializing asynchronously', () => { - var details + let details - beforeEach(function(done) { - makeTrace(agent, function(err, _details) { - details = _details - done(err) - }) + beforeEach(async() => { + details = await makeTrace(agent) }) - it('should produce a transaction trace in the expected format', function(done) { - details.trace.generateJSON(function(err, traceJSON) { - if (err) { - return done(err) - } - - codec.decode(traceJSON[4], function(derr, reconstituted) { - if (derr) { - return done(derr) - } - - expect(traceJSON, 'full trace JSON') - .to.deep.equal(details.expectedEncoding) + it('should produce a transaction trace in the expected format', async function() { + const traceJSON = await details.trace.generateJSONAsync() + const reconstituted = await codecDecodeAsync(traceJSON[4]) - expect(reconstituted, 'reconstituted trace segments') - .to.deep.equal(details.rootNode) + expect(traceJSON, 'full trace JSON') + .to.deep.equal(details.expectedEncoding) - return done() - }) - }) + expect(reconstituted, 'reconstituted trace segments') + .to.deep.equal(details.rootNode) }) - it('should send response time', function(done) { + it('should send response time', function() { details.transaction.getResponseTimeInMillis = function() { return 1234 } - details.trace.generateJSON(function(err, json, trace) { - expect(err).to.not.exist - expect(json[1]).to.equal(1234) - expect(trace).to.equal(details.trace) - done() - }) - }) - - describe('when `simple_compression` is `false`', function() { - it('should compress the segment arrays', function(done) { - details.trace.generateJSON(function(err, json) { + // not using `trace.generateJSONAsync` because + // util.promisify only returns 1st arg in callback + // see: https://github.com/nodejs/node/blob/master/lib/internal/util.js#L332 + return new Promise((resolve, reject) => { + details.trace.generateJSON((err, json, trace) => { if (err) { - return done(err) + reject(err) } - expect(json[4]) - .to.match(/^[a-zA-Z0-9\+\/]+={0,2}$/, 'should be base64 encoded') + expect(json[1]).to.equal(1234) + expect(trace).to.equal(details.trace) + resolve() + }) + }) + }) - codec.decode(json[4], function(err, data) { - if (err) { - return done(err) - } + describe('when `simple_compression` is `false`', function() { + it('should compress the segment arrays', async function() { + const json = await details.trace.generateJSONAsync() + expect(json[4]) + .to.match(/^[a-zA-Z0-9\+\/]+={0,2}$/, 'should be base64 encoded') - expect(data).to.deep.equal(details.rootNode) - done() - }) - }) + const data = await codecDecodeAsync(json[4]) + expect(data).to.deep.equal(details.rootNode) }) }) @@ -196,15 +166,9 @@ describe('Trace', function() { agent.config.simple_compression = true }) - it('should not compress the segment arrays', function(done) { - details.trace.generateJSON(function(err, json) { - if (err) { - return done(err) - } - - expect(json[4]).to.deep.equal(details.rootNode) - done() - }) + it('should not compress the segment arrays', async function() { + const json = await details.trace.generateJSONAsync() + expect(json[4]).to.deep.equal(details.rootNode) }) }) }) @@ -717,7 +681,7 @@ describe('Trace', function() { }) }) -tap.test('should set URI to null when request.uri attribute is excluded globally', (t) => { +tap.test('should set URI to null when request.uri attribute is excluded globally', async(t) => { const URL = '/test' const agent = helper.loadMockedAgent({ @@ -726,7 +690,7 @@ tap.test('should set URI to null when request.uri attribute is excluded globally } }) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -735,22 +699,17 @@ tap.test('should set URI to null when request.uri attribute is excluded globally transaction.verb = 'GET' const trace = transaction.trace + trace.generateJSON = util.promisify(trace.generateJSON) trace.end() - trace.generateJSON(function(err, traceJSON) { - if (err) { - t.error(err) - } - - const {3: requestUri} = traceJSON - t.notOk(requestUri) - - t.end() - }) + const traceJSON = await trace.generateJSON() + const {3: requestUri} = traceJSON + t.notOk(requestUri) + t.end() }) -tap.test('should set URI to null when request.uri attribute is exluded from traces', (t) => { +tap.test('should set URI to null when request.uri attribute is exluded from traces', async(t) => { const URL = '/test' const agent = helper.loadMockedAgent({ @@ -761,7 +720,7 @@ tap.test('should set URI to null when request.uri attribute is exluded from trac } }) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -770,46 +729,36 @@ tap.test('should set URI to null when request.uri attribute is exluded from trac transaction.verb = 'GET' const trace = transaction.trace + trace.generateJSON = util.promisify(trace.generateJSON) trace.end() - trace.generateJSON(function(err, traceJSON) { - if (err) { - t.error(err) - } - - const {3: requestUri} = traceJSON - t.notOk(requestUri) - - t.end() - }) + const traceJSON = await trace.generateJSON() + const {3: requestUri} = traceJSON + t.notOk(requestUri) + t.end() }) -tap.test('should set URI to /Unknown when URL is not known/set on transaction', (t) => { +tap.test('should set URI to /Unknown when URL is not known/set on transaction', async(t) => { const agent = helper.loadMockedAgent() - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) const transaction = new Transaction(agent) const trace = transaction.trace + trace.generateJSON = util.promisify(trace.generateJSON) trace.end() - trace.generateJSON(function(err, traceJSON) { - if (err) { - t.error(err) - } - - const {3: requestUri} = traceJSON - t.equal(requestUri, '/Unknown') - - t.end() - }) + const traceJSON = await trace.generateJSON() + const {3: requestUri} = traceJSON + t.equal(requestUri, '/Unknown') + t.end() }) -function makeTrace(agent, callback) { +async function makeTrace(agent) { var DURATION = 33 var URL = '/test?test=value' agent.config.attributes.enabled = true @@ -828,6 +777,10 @@ function makeTrace(agent, callback) { transaction.timer.setDurationInMillis(DURATION) var trace = transaction.trace + + // promisifying `trace.generateJSON` so tests do not have to call done + // and instead use async/await + trace.generateJSONAsync = util.promisify(trace.generateJSON) var start = trace.root.timer.start expect(start, 'root segment\'s start time').above(0) trace.setDurationInMillis(DURATION, 0) @@ -891,6 +844,26 @@ function makeTrace(agent, callback) { [] // FIXME: parameter groups ] + const encoded = await codecEncodeAsync(rootNode) + return { + transaction, + trace, + rootSegment, + rootNode, + expectedEncoding: [ + 0, + DURATION, + 'WebTransaction/NormalizedUri/*', // scope + '/test', // URI path + encoded, // compressed segment / segment data + transaction.id, // guid + null, // reserved, always NULL + false, // FIXME: RUM2 session persistence, not worrying about it for now + null, // FIXME: xraysessionid + null // syntheticsResourceId + ] + } + /* codec.encode(rootNode, function(err, encoded) { if (err) { return callback(err) @@ -914,7 +887,7 @@ function makeTrace(agent, callback) { null // syntheticsResourceId ] }) - }) + })*/ } tap.test('infinite tracing', (t) => { @@ -925,7 +898,7 @@ tap.test('infinite tracing', (t) => { let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent({ distributed_tracing: { enabled: true @@ -940,13 +913,10 @@ tap.test('infinite tracing', (t) => { } } }) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should generate spans if infinite configured, transaction not sampled', (t) => { diff --git a/test/unit/transaction.test.js b/test/unit/transaction.test.js index d64c4f571d..035971f7ae 100644 --- a/test/unit/transaction.test.js +++ b/test/unit/transaction.test.js @@ -1561,7 +1561,7 @@ tap.test('transaction end', (t) => { let agent = null let transaction = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent({ attributes: { enabled: true, @@ -1573,17 +1573,13 @@ tap.test('transaction end', (t) => { }) transaction = new Transaction(agent) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null transaction = null - - done() }) t.test('should clear errors', (t) => { @@ -1619,7 +1615,7 @@ tap.test('when being named with finalizeNameFromUri', (t) => { let agent = null let transaction = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent({ attributes: { enabled: true, @@ -1631,17 +1627,13 @@ tap.test('when being named with finalizeNameFromUri', (t) => { }) transaction = new Transaction(agent) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null transaction = null - - done() }) t.test('should throw when called with no parameters', (t) => { @@ -1779,7 +1771,7 @@ tap.test('requestd', (t) => { let agent = null let transaction = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent({ span_events: { enabled: true, @@ -1793,17 +1785,13 @@ tap.test('requestd', (t) => { }) transaction = new Transaction(agent) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null transaction = null - - done() }) t.test('when namestate populated should copy parameters from the name stack', (t) => { @@ -1831,7 +1819,7 @@ tap.test('when being named with finalizeName', (t) => { let agent = null let transaction = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent({ attributes: { enabled: true, @@ -1843,17 +1831,13 @@ tap.test('when being named with finalizeName', (t) => { }) transaction = new Transaction(agent) - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null transaction = null - - done() }) t.test('should call finalizeNameFromUri if no name is given for a web tx', (t) => { From 1c80c3642446761310dadf208e268da7cd1b2538 Mon Sep 17 00:00:00 2001 From: Bob Evans Date: Fri, 4 Jun 2021 12:04:01 -0400 Subject: [PATCH 04/13] fixed tap deprecation warnings on some older assertion methods --- test/unit/agent/agent.test.js | 14 +++--- test/unit/aggregators/base-aggregator.test.js | 4 +- test/unit/api/api-get-trace-metadata.test.js | 2 +- test/unit/api/api-notice-error.test.js | 4 +- test/unit/api/api-record-custom-event.test.js | 2 +- test/unit/api/api-shutdown.test.js | 20 ++++----- test/unit/attributes.test.js | 2 +- test/unit/collector/api-connect.test.js | 18 ++++---- test/unit/collector/api-login.test.js | 4 +- test/unit/collector/api-run-lifecycle.test.js | 18 ++++---- test/unit/collector/api.test.js | 24 +++++----- test/unit/collector/key-parser.test.js | 2 +- test/unit/collector/parse-response.test.js | 4 +- test/unit/collector/serverless.test.js | 16 +++---- test/unit/facts.test.js | 10 ++--- test/unit/grpc/connection.test.js | 44 +++++++++---------- test/unit/licenses.test.js | 2 +- .../unit/metric/normalizer-tx-segment.test.js | 2 +- test/unit/protocols.test.js | 2 +- test/unit/spans/map-to-streaming-type.test.js | 12 ++--- test/unit/spans/span-streamer.test.js | 24 +++++----- .../spans/streaming-span-attributes.test.js | 12 ++--- test/unit/trace-segment.test.js | 16 +++---- test/unit/util/label-parser.test.js | 4 +- 24 files changed, 131 insertions(+), 131 deletions(-) diff --git a/test/unit/agent/agent.test.js b/test/unit/agent/agent.test.js index 8c73edf382..9ede7951dc 100644 --- a/test/unit/agent/agent.test.js +++ b/test/unit/agent/agent.test.js @@ -210,7 +210,7 @@ tap.test('#startAggregators should start all aggregators', (t) => { let agent = helper.loadMockedAgent(null, false) agent.config.distributed_tracing.enabled = true // for span events - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -231,7 +231,7 @@ tap.test('#startAggregators should start all aggregators', (t) => { let agent = helper.loadMockedAgent(null, false) agent.config.distributed_tracing.enabled = true // for span events - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -252,7 +252,7 @@ tap.test('#stopAggregators should stop all aggregators', (t) => { let agent = helper.loadMockedAgent(null, false) agent.config.distributed_tracing.enabled = true // for span events - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -276,7 +276,7 @@ tap.test('#onConnect should reconfigure all the aggregators', (t) => { let agent = helper.loadMockedAgent(null, false) agent.config.distributed_tracing.enabled = true // for span events - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -758,7 +758,7 @@ tap.test('when connected', (t) => { t.equal(agent._state, 'started') t.equal(agent.config.run_id, 404) t.equal(agent.metrics._apdexT, 0.742) - t.deepEqual(agent.urlNormalizer.rules, []) + t.same(agent.urlNormalizer.rules, []) agent.stop(function cb_stop() { t.ok(settings.isDone()) @@ -887,7 +887,7 @@ tap.test('when sampling_target changes', (t) => { }) t.test('should adjust the current sampling target', (t) => { - t.notEqual(agent.transactionSampler.samplingTarget, 5) + t.not(agent.transactionSampler.samplingTarget, 5) agent.config.onConnect({sampling_target: 5}) t.equal(agent.transactionSampler.samplingTarget, 5) @@ -895,7 +895,7 @@ tap.test('when sampling_target changes', (t) => { }) t.test('should adjust the sampling period', (t) => { - t.notEqual(agent.transactionSampler.samplingPeriod, 100) + t.not(agent.transactionSampler.samplingPeriod, 100) agent.config.onConnect({sampling_target_period_in_seconds: 0.1}) t.equal(agent.transactionSampler.samplingPeriod, 100) diff --git a/test/unit/aggregators/base-aggregator.test.js b/test/unit/aggregators/base-aggregator.test.js index 7db2aa1a8a..b353360183 100644 --- a/test/unit/aggregators/base-aggregator.test.js +++ b/test/unit/aggregators/base-aggregator.test.js @@ -191,7 +191,7 @@ tap.test('send', (t) => { baseAggregator.send() - t.deepEqual(invokedPayload, expectedPayload) + t.same(invokedPayload, expectedPayload) t.end() }) @@ -235,7 +235,7 @@ tap.test('send', (t) => { baseAggregator.send() - t.deepEqual(mergeData, expectedData) + t.same(mergeData, expectedData) t.end() }) diff --git a/test/unit/api/api-get-trace-metadata.test.js b/test/unit/api/api-get-trace-metadata.test.js index fc1b45f948..677e2a057c 100644 --- a/test/unit/api/api-get-trace-metadata.test.js +++ b/test/unit/api/api-get-trace-metadata.test.js @@ -51,7 +51,7 @@ tap.test('Agent API - trace metadata', (t) => { const metadata = api.getTraceMetadata() t.type(metadata, 'object') - t.deepEqual(metadata, {}) + t.same(metadata, {}) t.end() }) }) diff --git a/test/unit/api/api-notice-error.test.js b/test/unit/api/api-notice-error.test.js index 8f632bbd70..8452cec176 100644 --- a/test/unit/api/api-notice-error.test.js +++ b/test/unit/api/api-notice-error.test.js @@ -55,7 +55,7 @@ tap.test('Agent API - noticeError', (t) => { t.equal(agent.errors.traceAggregator.errors.length, 1) const attributes = agent.errors.traceAggregator.errors[0][4] - t.deepEqual(attributes.userAttributes, {}) + t.same(attributes.userAttributes, {}) agent.config.api.custom_attributes_enabled = true t.end() @@ -69,7 +69,7 @@ tap.test('Agent API - noticeError', (t) => { t.equal(agent.errors.traceAggregator.errors.length, 1) const attributes = agent.errors.traceAggregator.errors[0][4] - t.deepEqual(attributes.userAttributes, {}) + t.same(attributes.userAttributes, {}) agent.config.high_security = false t.end() diff --git a/test/unit/api/api-record-custom-event.test.js b/test/unit/api/api-record-custom-event.test.js index 85ab1f7c62..89c016d583 100644 --- a/test/unit/api/api-record-custom-event.test.js +++ b/test/unit/api/api-record-custom-event.test.js @@ -102,7 +102,7 @@ tap.test('Agent API - recordCustomEvent', (t) => { const myEvent = popTopCustomEvent(agent) const userAttributes = myEvent[1] - t.deepEqual(userAttributes, data) + t.same(userAttributes, data) t.end() }) diff --git a/test/unit/api/api-shutdown.test.js b/test/unit/api/api-shutdown.test.js index 1bf1b80cda..e07c3291f1 100644 --- a/test/unit/api/api-shutdown.test.js +++ b/test/unit/api/api-shutdown.test.js @@ -30,7 +30,7 @@ tap.test('Agent API - shutdown', (t) => { t.test('exports a shutdown function', (t) => { setupAgentApi() - t.tearDown(() => { + t.teardown(() => { cleanupAgentApi() }) @@ -42,7 +42,7 @@ tap.test('Agent API - shutdown', (t) => { t.test('calls agent stop', (t) => { setupAgentApi() - t.tearDown(() => { + t.teardown(() => { cleanupAgentApi() }) @@ -56,7 +56,7 @@ tap.test('Agent API - shutdown', (t) => { t.test('accepts callback as second argument', (t) => { setupAgentApi() - t.tearDown(cleanupAgentApi) + t.teardown(cleanupAgentApi) agent.stop = function(cb) { cb() @@ -71,7 +71,7 @@ tap.test('Agent API - shutdown', (t) => { t.test('accepts callback as first argument', (t) => { setupAgentApi() - t.tearDown(cleanupAgentApi) + t.teardown(cleanupAgentApi) agent.stop = function(cb) { cb() @@ -86,7 +86,7 @@ tap.test('Agent API - shutdown', (t) => { t.test('does not error when no callback is provided', (t) => { setupAgentApi() - t.tearDown(cleanupAgentApi) + t.teardown(cleanupAgentApi) // should not throw api.shutdown() @@ -192,7 +192,7 @@ tap.test('Agent API - shutdown', (t) => { t.test('calls forceHarvestAll when a timeout is given and not reached', (t) => { setupAgentApi() - t.tearDown(cleanupAgentApi) + t.teardown(cleanupAgentApi) const mock = sinon.mock(agent) agent.setState('starting') @@ -221,7 +221,7 @@ tap.test('Agent API - shutdown', (t) => { return timeoutHandle } - t.tearDown(() => { + t.teardown(() => { timeoutHandle.unref() timeoutHandle = null global.setTimeout = originalSetTimeout @@ -253,7 +253,7 @@ tap.test('Agent API - shutdown', (t) => { t.test('calls forceHarvestAll when timeout is not a number', (t) => { setupAgentApi() - t.tearDown(cleanupAgentApi) + t.teardown(cleanupAgentApi) agent.setState('starting') @@ -280,7 +280,7 @@ tap.test('Agent API - shutdown', (t) => { t.test('calls stop after harvest', (t) => { setupAgentApi() - t.tearDown(cleanupAgentApi) + t.teardown(cleanupAgentApi) agent.setState('starting') @@ -307,7 +307,7 @@ tap.test('Agent API - shutdown', (t) => { t.test('calls stop when harvest errors', (t) => { setupAgentApi() - t.tearDown(cleanupAgentApi) + t.teardown(cleanupAgentApi) agent.setState('starting') diff --git a/test/unit/attributes.test.js b/test/unit/attributes.test.js index 0d43a93631..9c08354215 100644 --- a/test/unit/attributes.test.js +++ b/test/unit/attributes.test.js @@ -280,7 +280,7 @@ tap.test('#reset', (t) => { inst.reset() - t.deepEqual(inst.attributes, {}) + t.same(inst.attributes, {}) t.end() }) diff --git a/test/unit/collector/api-connect.test.js b/test/unit/collector/api-connect.test.js index dbd7b8bde4..ee70474bcb 100644 --- a/test/unit/collector/api-connect.test.js +++ b/test/unit/collector/api-connect.test.js @@ -28,7 +28,7 @@ tap.test('requires a callback', (t) => { const agent = setupMockedAgent() const collectorApi = new CollectorApi(agent) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -96,7 +96,7 @@ tap.test('receiving 200 response, with valid data', (t) => { t.test('should pass through server-side configuration untouched', (t) => { collectorApi.connect((error, res) => { const ssc = res.payload - t.deepEqual(ssc, validSsc) + t.same(ssc, validSsc) redirection.done() connection.done() @@ -225,7 +225,7 @@ tap.test('succeeds when given a different port number for redirect', (t) => { t.test('should pass through server-side configuration untouched', (t) => { collectorApi.connect(function test(error, res) { const ssc = res.payload - t.deepEqual(ssc, validSsc) + t.same(ssc, validSsc) redirection.done() connection.done() @@ -304,7 +304,7 @@ tap.test('succeeds after one 503 on preconnect', (t) => { t.test('should pass through server-side configuration untouched', (t) => { testConnect(t, () => { - t.deepEqual(ssc, valid) + t.same(ssc, valid) t.end() }) }) @@ -394,7 +394,7 @@ tap.test('succeeds after five 503s on preconnect', (t) => { t.test('should pass through server-side configuration untouched', (t) => { testConnect(t, () => { - t.deepEqual(ssc, valid) + t.same(ssc, valid) t.end() }) }) @@ -661,7 +661,7 @@ over http. When setting `proxy_host` and `proxy_port` New Relic attempts to conn SSL(https). If your proxy is configured to accept connections over http, try setting `proxy` \ to a fully qualified URL(e.g http://proxy-host:8080).' - t.deepEqual(loggerMock.warn.args, [ + t.same(loggerMock.warn.args, [ [ error, expectErrorMsg @@ -674,7 +674,7 @@ to a fully qualified URL(e.g http://proxy-host:8080).' t.test('should not log warning when proxy is configured properly but still get EPROTO', (t) => { collectorApi._agent.config.proxy = 'http://test-proxy-server:8080' testConnect(t, () => { - t.deepEqual(loggerMock.warn.args, [], 'Proxy misconfigured message not logged') + t.same(loggerMock.warn.args, [], 'Proxy misconfigured message not logged') t.end() }) }) @@ -747,7 +747,7 @@ tap.test('in a LASP/CSP enabled agent', (t) => { .reply(200, response) collectorApi.connect(function test(error, res) { - t.deepEqual(res.payload, valid) + t.same(res.payload, valid) redirection.done() connection.done() @@ -783,7 +783,7 @@ tap.test('in a LASP/CSP enabled agent', (t) => { .reply(200, response) collectorApi.connect(function test(error, res) { - t.deepEqual(res.payload, valid) + t.same(res.payload, valid) t.equal(agent.customEventAggregator.length, 0) diff --git a/test/unit/collector/api-login.test.js b/test/unit/collector/api-login.test.js index 04e05abe6c..d636df5fef 100644 --- a/test/unit/collector/api-login.test.js +++ b/test/unit/collector/api-login.test.js @@ -277,7 +277,7 @@ tap.test('should copy request headers', (t) => { .reply(200, response) collectorApi._login(function test() { - t.deepEqual(collectorApi._reqHeadersMap, reqHeaderMap) + t.same(collectorApi._reqHeadersMap, reqHeaderMap) redirection.done() connection.done() @@ -355,7 +355,7 @@ tap.test('receiving 200 response, with valid data', (t) => { t.test('should pass through server-side configuration untouched', (t) => { collectorApi._login(function test(error, res) { const ssc = res.payload - t.deepEqual(ssc, validSsc) + t.same(ssc, validSsc) redirection.done() connection.done() diff --git a/test/unit/collector/api-run-lifecycle.test.js b/test/unit/collector/api-run-lifecycle.test.js index 43198ab3bb..fe429b8f74 100644 --- a/test/unit/collector/api-run-lifecycle.test.js +++ b/test/unit/collector/api-run-lifecycle.test.js @@ -20,7 +20,7 @@ tap.test('should bail out if disconnected', (t) => { const agent = setupMockedAgent() const collectorApi = new CollectorApi(agent) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -42,7 +42,7 @@ tap.test('should discard HTTP 413 errors', (t) => { nock.disableNetConnect() - t.tearDown(() => { + t.teardown(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -78,7 +78,7 @@ tap.test('should discard HTTP 415 errors', (t) => { nock.disableNetConnect() - t.tearDown(() => { + t.teardown(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -114,7 +114,7 @@ tap.test('should retain after HTTP 500 errors', (t) => { nock.disableNetConnect() - t.tearDown(() => { + t.teardown(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -150,7 +150,7 @@ tap.test('should retain after HTTP 503 errors', (t) => { nock.disableNetConnect() - t.tearDown(() => { + t.teardown(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -186,7 +186,7 @@ tap.test('should indicate a restart and discard data after 401 errors', (t) => { nock.disableNetConnect() - t.tearDown(() => { + t.teardown(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -223,7 +223,7 @@ tap.test('should indicate a restart and discard data after 409 errors', (t) => { nock.disableNetConnect() - t.tearDown(() => { + t.teardown(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -260,7 +260,7 @@ tap.test('should stop the agent on 410 (force disconnect)', (t) => { nock.disableNetConnect() - t.tearDown(() => { + t.teardown(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) @@ -303,7 +303,7 @@ tap.test('should discard unexpected HTTP errors (501)', (t) => { nock.disableNetConnect() - t.tearDown(() => { + t.teardown(() => { if (!nock.isDone()) { /* eslint-disable no-console */ console.error('Cleaning pending mocks: %j', nock.pendingMocks()) diff --git a/test/unit/collector/api.test.js b/test/unit/collector/api.test.js index 7439ef36ff..9703fb7e85 100644 --- a/test/unit/collector/api.test.js +++ b/test/unit/collector/api.test.js @@ -67,7 +67,7 @@ tap.test('reportSettings', (t) => { t.test('should return the expected `empty` response', (t) => { collectorApi.reportSettings((error, res) => { - t.deepEqual(res.payload, emptySettingsPayload.return_value) + t.same(res.payload, emptySettingsPayload.return_value) settings.done() @@ -83,7 +83,7 @@ tap.test('error_data', (t) => { const agent = setupMockedAgent() const collectorApi = new CollectorApi(agent) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -99,7 +99,7 @@ tap.test('error_data', (t) => { const agent = setupMockedAgent() const collectorApi = new CollectorApi(agent) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -185,7 +185,7 @@ tap.test('sql_trace_data', (t) => { const agent = setupMockedAgent() const collectorApi = new CollectorApi(agent) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -201,7 +201,7 @@ tap.test('sql_trace_data', (t) => { const agent = setupMockedAgent() const collectorApi = new CollectorApi(agent) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -292,7 +292,7 @@ tap.test('analytic_event_data (transaction events)', (t) => { const agent = setupMockedAgent() const collectorApi = new CollectorApi(agent) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -308,7 +308,7 @@ tap.test('analytic_event_data (transaction events)', (t) => { const agent = setupMockedAgent() const collectorApi = new CollectorApi(agent) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -402,7 +402,7 @@ tap.test('metric_data', (t) => { const agent = setupMockedAgent() const collectorApi = new CollectorApi(agent) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -418,7 +418,7 @@ tap.test('metric_data', (t) => { const agent = setupMockedAgent() const collectorApi = new CollectorApi(agent) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -508,7 +508,7 @@ tap.test('transaction_sample_data (transaction trace)', (t) => { const agent = setupMockedAgent() const collectorApi = new CollectorApi(agent) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -524,7 +524,7 @@ tap.test('transaction_sample_data (transaction trace)', (t) => { const agent = setupMockedAgent() const collectorApi = new CollectorApi(agent) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -607,7 +607,7 @@ tap.test('shutdown', (t) => { const agent = setupMockedAgent() const collectorApi = new CollectorApi(agent) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) diff --git a/test/unit/collector/key-parser.test.js b/test/unit/collector/key-parser.test.js index d5a9df7e01..8890e13432 100644 --- a/test/unit/collector/key-parser.test.js +++ b/test/unit/collector/key-parser.test.js @@ -12,7 +12,7 @@ tap.test('collector license key parser', (t) => { t.test('should return the region prefix when a region is detected', (t) => { const testKey = 'eu01xx66c637a29c3982469a3fe8d1982d002c4a' const region = parse(testKey) - t.equals(region, 'eu01') + t.equal(region, 'eu01') t.end() }) diff --git a/test/unit/collector/parse-response.test.js b/test/unit/collector/parse-response.test.js index c7333f9140..cab487617e 100644 --- a/test/unit/collector/parse-response.test.js +++ b/test/unit/collector/parse-response.test.js @@ -42,7 +42,7 @@ tap.test('when initialized properly and response status is 200', (t) => { t.test('should pass through return value', (t) => { function callback(error, res) { - t.deepEqual(res.payload, [1,1,2,3,5,8]) + t.same(res.payload, [1,1,2,3,5,8]) t.end() } @@ -157,7 +157,7 @@ tap.test('when initialized properly and response status is 503', (t) => { function callback(error, res) { t.error(error) - t.deepEqual(res.payload, [1,1,2,3,5,8]) + t.same(res.payload, [1,1,2,3,5,8]) t.equal(res.status, 503) t.end() diff --git a/test/unit/collector/serverless.test.js b/test/unit/collector/serverless.test.js index 10d997f0a2..3cdf6cde2c 100644 --- a/test/unit/collector/serverless.test.js +++ b/test/unit/collector/serverless.test.js @@ -99,7 +99,7 @@ tap.test('ServerlessCollector API', (t) => { t.test('adds metric_data to the payload object', (t) => { const metricData = {type: 'metric_data'} api.metric_data(metricData, () => { - t.deepEqual(api.payload.metric_data, metricData) + t.same(api.payload.metric_data, metricData) t.end() }) }) @@ -114,7 +114,7 @@ tap.test('ServerlessCollector API', (t) => { t.test('adds error_data to the payload object', (t) => { const errorData = {type: 'error_data'} api.error_data(errorData, () => { - t.deepEqual(api.payload.error_data, errorData) + t.same(api.payload.error_data, errorData) t.end() }) }) @@ -129,7 +129,7 @@ tap.test('ServerlessCollector API', (t) => { t.test('adds transaction_sample_data to the payload object', (t) => { const transactionSampleData = {type: 'transaction_sample_data'} api.transaction_sample_data(transactionSampleData, () => { - t.deepEqual(api.payload.transaction_sample_data, transactionSampleData) + t.same(api.payload.transaction_sample_data, transactionSampleData) t.end() }) }) @@ -144,7 +144,7 @@ tap.test('ServerlessCollector API', (t) => { t.test('adds analytic_event_data to the payload object', (t) => { const analyticsEvents = {type: 'analytic_event_data'} api.analytic_event_data(analyticsEvents, () => { - t.deepEqual(api.payload.analytic_event_data, analyticsEvents) + t.same(api.payload.analytic_event_data, analyticsEvents) t.end() }) @@ -160,7 +160,7 @@ tap.test('ServerlessCollector API', (t) => { t.test('adds custom_event_data to the payload object', (t) => { const customEvents = {type: 'custom_event_data'} api.custom_event_data(customEvents, () => { - t.deepEqual(api.payload.custom_event_data, customEvents) + t.same(api.payload.custom_event_data, customEvents) t.end() }) }) @@ -175,7 +175,7 @@ tap.test('ServerlessCollector API', (t) => { t.test('adds error_event_data to the payload object', (t) => { const errorEvents = {type: 'error_event_data'} api.error_event_data(errorEvents, () => { - t.deepEqual(api.payload.error_event_data, errorEvents) + t.same(api.payload.error_event_data, errorEvents) t.end() }) }) @@ -190,7 +190,7 @@ tap.test('ServerlessCollector API', (t) => { t.test('adds span_event_data to the payload object', (t) => { const spanEvents = {type: 'span_event_data'} api.span_event_data(spanEvents, () => { - t.deepEqual(api.payload.span_event_data, spanEvents) + t.same(api.payload.span_event_data, spanEvents) t.end() }) }) @@ -213,7 +213,7 @@ tap.test('ServerlessCollector API', (t) => { const decoded = JSON.parse(zlib.gunzipSync(Buffer.from(data, 'base64'))) t.ok(decoded.metadata) t.ok(decoded.data) - t.deepEqual(decoded.data, testPayload) + t.same(decoded.data, testPayload) } api.flushPayloadSync() t.equal(Object.keys(api.payload).length, 0) diff --git a/test/unit/facts.test.js b/test/unit/facts.test.js index 8949139911..dc78cc3962 100644 --- a/test/unit/facts.test.js +++ b/test/unit/facts.test.js @@ -157,7 +157,7 @@ tap.test('fun facts about apps that New Relic is interested in include', (t) => expect(data.metadata).to.have.property('NEW_RELIC_METADATA_STRING', 'hello') expect(data.metadata).to.have.property('NEW_RELIC_METADATA_BOOL', 'true') expect(data.metadata).to.have.property('NEW_RELIC_METADATA_NUMBER', '42') - t.deepEqual(loggerMock.debug.args, [ + t.same(loggerMock.debug.args, [ [ 'New Relic metadata %o', { @@ -632,15 +632,15 @@ tap.test('display_host', {timeout: 20000}, (t) => { agent.config.process_host.display_name = 'test-value2' facts(agent, function getFacts2(factsed2) { - t.deepEqual(factsed2.display_host, displayHost1) - t.deepEqual(factsed2.host, host1) + t.same(factsed2.display_host, displayHost1) + t.same(factsed2.host, host1) agent.config.clearHostnameCache() agent.config.clearDisplayHostCache() facts(agent, function getFacts3(factsed3) { - t.deepEqual(factsed3.display_host, 'test-value2') - t.deepEqual(factsed3.host, os.hostname()) + t.same(factsed3.display_host, 'test-value2') + t.same(factsed3.host, os.hostname()) t.end() }) diff --git a/test/unit/grpc/connection.test.js b/test/unit/grpc/connection.test.js index d120b5b256..5a311ff642 100644 --- a/test/unit/grpc/connection.test.js +++ b/test/unit/grpc/connection.test.js @@ -64,12 +64,12 @@ tap.test( {}, {} ) - t.equals(metadataFirst.get('license_key').shift(), 'fake-license', 'license key set') - t.equals(metadataFirst.get('agent_run_token').shift(), 'fake-run-id', 'run id set') - t.equals(metadataFirst.get('flaky').length, 0, 'flaky not set') - t.equals(metadataFirst.get('delay').length, 0, 'delay not set') - t.equals(metadataFirst.get('flaky_code').length, 0, 'flaky_code not set') - t.equals(metadataFirst.get('success_delay_ms').length, 0, 'success_delay_ms not set') + t.equal(metadataFirst.get('license_key').shift(), 'fake-license', 'license key set') + t.equal(metadataFirst.get('agent_run_token').shift(), 'fake-run-id', 'run id set') + t.equal(metadataFirst.get('flaky').length, 0, 'flaky not set') + t.equal(metadataFirst.get('delay').length, 0, 'delay not set') + t.equal(metadataFirst.get('flaky_code').length, 0, 'flaky_code not set') + t.equal(metadataFirst.get('success_delay_ms').length, 0, 'success_delay_ms not set') // tests that env based params get set const metadataSecond = connection._getMetadata( @@ -84,12 +84,12 @@ tap.test( } ) - t.equals(metadataSecond.get('license_key').shift(), 'fake-license', 'license key set') - t.equals(metadataSecond.get('agent_run_token').shift(), 'fake-run-id', 'run id set') - t.equals(metadataSecond.get('flaky').shift(), 10, 'flaky set') - t.equals(metadataSecond.get('delay').shift(), 20, 'delay set') - t.equals(metadataSecond.get('flaky_code').shift(), 7, 'flaky_code set') - t.equals(metadataSecond.get('success_delay_ms').shift(), 400, 'success_delay_ms set') + t.equal(metadataSecond.get('license_key').shift(), 'fake-license', 'license key set') + t.equal(metadataSecond.get('agent_run_token').shift(), 'fake-run-id', 'run id set') + t.equal(metadataSecond.get('flaky').shift(), 10, 'flaky set') + t.equal(metadataSecond.get('delay').shift(), 20, 'delay set') + t.equal(metadataSecond.get('flaky_code').shift(), 7, 'flaky_code set') + t.equal(metadataSecond.get('success_delay_ms').shift(), 400, 'success_delay_ms set') // tests that env based params get set const metadataThird = connection._getMetadata( @@ -104,12 +104,12 @@ tap.test( } ) - t.equals(metadataThird.get('license_key').shift(), 'fake-license', 'license key set') - t.equals(metadataThird.get('agent_run_token').shift(), 'fake-run-id', 'run id set') - t.equals(metadataThird.get('flaky').length, 0, 'flaky not set') - t.equals(metadataThird.get('delay').length, 0, 'delay not set') - t.equals(metadataFirst.get('flaky_code').length, 0, 'flaky_code not set') - t.equals(metadataFirst.get('success_delay_ms').length, 0, 'success_delay_ms not set') + t.equal(metadataThird.get('license_key').shift(), 'fake-license', 'license key set') + t.equal(metadataThird.get('agent_run_token').shift(), 'fake-run-id', 'run id set') + t.equal(metadataThird.get('flaky').length, 0, 'flaky not set') + t.equal(metadataThird.get('delay').length, 0, 'delay not set') + t.equal(metadataFirst.get('flaky_code').length, 0, 'flaky_code not set') + t.equal(metadataFirst.get('success_delay_ms').length, 0, 'success_delay_ms not set') t.end() }) @@ -137,8 +137,8 @@ tap.test( {} ) - t.deepEqual(metadata.get('key_1'), ['VALUE 1']) - t.deepEqual(metadata.get('key_2'), ['VALUE 2']) + t.same(metadata.get('key_1'), ['VALUE 1']) + t.same(metadata.get('key_2'), ['VALUE 2']) t.end() }) @@ -151,7 +151,7 @@ tap.test('grpc connection error handling', (test) => { test.test('should catch error when proto loader fails', (t) => { const stub = sinon.stub(protoLoader, 'loadSync').returns({}) - t.tearDown(() => { + t.teardown(() => { stub.restore() }) @@ -168,7 +168,7 @@ tap.test('grpc connection error handling', (test) => { test.test('should catch error when loadPackageDefinition returns invalid service definition', (t) => { const stub = sinon.stub(grpcApi, 'loadPackageDefinition').returns({}) - t.tearDown(() => { + t.teardown(() => { stub.restore() }) diff --git a/test/unit/licenses.test.js b/test/unit/licenses.test.js index a29b319da7..187103a6e0 100644 --- a/test/unit/licenses.test.js +++ b/test/unit/licenses.test.js @@ -50,7 +50,7 @@ test('should all be accounted for in LICENSES object', {timeout: 5000}, (t) => { return obj }, {}) - t.deepEqual(depLicenses, licenses, LICENSE_MESSAGE) + t.same(depLicenses, licenses, LICENSE_MESSAGE) t.end() }) }) diff --git a/test/unit/metric/normalizer-tx-segment.test.js b/test/unit/metric/normalizer-tx-segment.test.js index 897c5ecb7b..d80d24b6db 100644 --- a/test/unit/metric/normalizer-tx-segment.test.js +++ b/test/unit/metric/normalizer-tx-segment.test.js @@ -31,7 +31,7 @@ tap.test('The TxSegmentNormalizer', (t) => { }] const normalizer = new TxSegmentNormalizer() normalizer.load(input) - t.deepEqual(normalizer.terms, input) + t.same(normalizer.terms, input) t.end() }) diff --git a/test/unit/protocols.test.js b/test/unit/protocols.test.js index 7091d8fa87..3852c2d29f 100644 --- a/test/unit/protocols.test.js +++ b/test/unit/protocols.test.js @@ -33,7 +33,7 @@ tap.test('errors', (t) => { const payload = agent.errors.traceAggregator._toPayloadSync() RemoteMethod.prototype.serialize(payload, (err, errors) => { t.equal(err, null) - t.deepEqual(errors, + t.same(errors, '[1,[[0,"Unknown","test","Error",{"userAttributes":{},"agentAttributes":{},' + '"intrinsics":{"error.expected":false},"stack_trace":["test stack"]}]]]' ) diff --git a/test/unit/spans/map-to-streaming-type.test.js b/test/unit/spans/map-to-streaming-type.test.js index 96526ef561..297e32797c 100644 --- a/test/unit/spans/map-to-streaming-type.test.js +++ b/test/unit/spans/map-to-streaming-type.test.js @@ -16,7 +16,7 @@ tap.test('should corectly convert strings', (t) => { } const result = mapToStreamingType(stringValue) - t.deepEqual(result, expected) + t.same(result, expected) t.end() }) @@ -27,7 +27,7 @@ tap.test('should not drop empty strings', (t) => { } const result = mapToStreamingType(stringValue) - t.deepEqual(result, expected) + t.same(result, expected) t.end() }) @@ -38,7 +38,7 @@ tap.test('should correctly convert bools when true', (t) => { } const result = mapToStreamingType(boolValue) - t.deepEqual(result, expected) + t.same(result, expected) t.end() }) @@ -49,7 +49,7 @@ tap.test('should correctly convert bools when false', (t) => { } const result = mapToStreamingType(boolValue) - t.deepEqual(result, expected) + t.same(result, expected) t.end() }) @@ -60,7 +60,7 @@ tap.test('should correctly convert integers', (t) => { } const result = mapToStreamingType(intValue) - t.deepEqual(result, expected) + t.same(result, expected) t.end() }) @@ -71,7 +71,7 @@ tap.test('should correctly convert doubles', (t) => { } const result = mapToStreamingType(doubleValue) - t.deepEqual(result, expected) + t.same(result, expected) t.end() }) diff --git a/test/unit/spans/span-streamer.test.js b/test/unit/spans/span-streamer.test.js index fba2eabc53..1eeb9f7d0b 100644 --- a/test/unit/spans/span-streamer.test.js +++ b/test/unit/spans/span-streamer.test.js @@ -136,10 +136,10 @@ tap.test('Should add span to queue on backpressure', (t) => { fakeConnection.connectSpans() spanStreamer._writable = false - t.equals(spanStreamer.spans.length, 0, 'no spans queued') + t.equal(spanStreamer.spans.length, 0, 'no spans queued') spanStreamer.write({}) - t.equals(spanStreamer.spans.length, 1, 'one span queued') + t.equal(spanStreamer.spans.length, 1, 'one span queued') t.end() }) @@ -166,7 +166,7 @@ tap.test('Should drain span queue on stream drain event', (t) => { fakeConnection.connectSpans() - t.equals(spanStreamer.spans.length, 0, 'no spans queued') + t.equal(spanStreamer.spans.length, 0, 'no spans queued') const fakeSpan = { toStreamingFormat: () => {} } @@ -174,17 +174,17 @@ tap.test('Should drain span queue on stream drain event', (t) => { spanStreamer.write(fakeSpan) spanStreamer.write(fakeSpan) - t.equals(spanStreamer.spans.length, 1, 'one span queued') + t.equal(spanStreamer.spans.length, 1, 'one span queued') /* emit drain event and allow writes */ fakeStream.emit('drain', fakeStream.write = () => true) - t.equals(spanStreamer.spans.length, 0, 'drained spans') - t.equals( + t.equal(spanStreamer.spans.length, 0, 'drained spans') + t.equal( metrics.getOrCreateMetric (METRIC_NAMES.INFINITE_TRACING.DRAIN_DURATION).callCount, 1, 'DRAIN_DURATION metric') - t.equals(metrics + t.equal(metrics .getOrCreateMetric(METRIC_NAMES.INFINITE_TRACING.SENT).callCount, 2, 'SENT metric incremented') fakeStream.destroy() @@ -214,7 +214,7 @@ tap.test('Should properly format spans sent from the queue', (t) => { fakeConnection.connectSpans() - t.equals(spanStreamer.spans.length, 0, 'no spans queued') + t.equal(spanStreamer.spans.length, 0, 'no spans queued') const fakeSpan = new SpanStreamerEvent('sandwich', {}, {}) const fakeSpan_queued = new SpanStreamerEvent('porridge', {}, {}) @@ -222,7 +222,7 @@ tap.test('Should properly format spans sent from the queue', (t) => { spanStreamer.write(fakeSpan) spanStreamer.write(fakeSpan_queued) - t.equals(spanStreamer.spans.length, 1, 'one span queued') + t.equal(spanStreamer.spans.length, 1, 'one span queued') /* emit drain event, allow writes and check for span.trace_id */ fakeStream.emit('drain', fakeStream.write = (span) => { @@ -231,12 +231,12 @@ tap.test('Should properly format spans sent from the queue', (t) => { return true }) - t.equals(spanStreamer.spans.length, 0, 'drained spans') - t.equals( + t.equal(spanStreamer.spans.length, 0, 'drained spans') + t.equal( metrics.getOrCreateMetric (METRIC_NAMES.INFINITE_TRACING.DRAIN_DURATION).callCount, 1, 'DRAIN_DURATION metric') - t.equals(metrics + t.equal(metrics .getOrCreateMetric(METRIC_NAMES.INFINITE_TRACING.SENT).callCount, 2, 'SENT metric incremented') fakeStream.destroy() diff --git a/test/unit/spans/streaming-span-attributes.test.js b/test/unit/spans/streaming-span-attributes.test.js index f12d95ac0f..9fb3a5f977 100644 --- a/test/unit/spans/streaming-span-attributes.test.js +++ b/test/unit/spans/streaming-span-attributes.test.js @@ -21,7 +21,7 @@ tap.test('addAttribute() should add a valid value', (t) => { const attributes = new StreamingSpanAttributes() attributes.addAttribute(testKey, testValue) - t.deepEqual(attributes, expected) + t.same(attributes, expected) t.end() }) @@ -33,7 +33,7 @@ tap.test('addAttribute() should drp an invalid value', (t) => { const attributes = new StreamingSpanAttributes() attributes.addAttribute(testKey, testValue) - t.deepEqual(attributes, expected) + t.same(attributes, expected) t.end() }) @@ -55,7 +55,7 @@ tap.test('addAttributes() should add all valid values', (t) => { const attributes = new StreamingSpanAttributes() attributes.addAttributes(incomingAttributes) - t.deepEqual(attributes, expected) + t.same(attributes, expected) t.end() }) @@ -76,7 +76,7 @@ tap.test('addAttributes() should drop all invalid values', (t) => { const attributes = new StreamingSpanAttributes() attributes.addAttributes(incomingAttributes) - t.deepEqual(attributes, expected) + t.same(attributes, expected) t.end() }) @@ -97,7 +97,7 @@ tap.test('constructor should add all valid values', (t) => { const attributes = new StreamingSpanAttributes(incomingAttributes) - t.deepEqual(attributes, expected) + t.same(attributes, expected) t.end() }) @@ -117,6 +117,6 @@ tap.test('addAttributes() should drop all invalid values', (t) => { const attributes = new StreamingSpanAttributes(incomingAttributes) - t.deepEqual(attributes, expected) + t.same(attributes, expected) t.end() }) diff --git a/test/unit/trace-segment.test.js b/test/unit/trace-segment.test.js index a7f99a09af..3ba0c3eeab 100644 --- a/test/unit/trace-segment.test.js +++ b/test/unit/trace-segment.test.js @@ -199,7 +199,7 @@ tap.test('TraceSegment', (t) => { const transaction = new Transaction(agent) const segment = new TraceSegment(transaction, 'TestSegment') segment.toJSON() - t.deepEqual(segment.getAttributes(), {}) + t.same(segment.getAttributes(), {}) t.end() }) @@ -256,7 +256,7 @@ tap.test('TraceSegment', (t) => { }) t.test('should serialize the segment with the parameters', (t) => { - t.deepEqual(webChild.toJSON(), [ + t.same(webChild.toJSON(), [ 0, 1, 'WebTransaction/NormalizedUri/*', { @@ -342,7 +342,7 @@ tap.test('TraceSegment', (t) => { }, [] ] - t.deepEqual(webChild.toJSON(), expected) + t.same(webChild.toJSON(), expected) t.end() }) }) @@ -374,7 +374,7 @@ tap.test('TraceSegment', (t) => { }) t.test('should have no attributes on the child segment', (t) => { - t.deepEqual(webChild.getAttributes(), {}) + t.same(webChild.getAttributes(), {}) t.end() }) @@ -386,7 +386,7 @@ tap.test('TraceSegment', (t) => { {}, [] ] - t.deepEqual(webChild.toJSON(), expected) + t.same(webChild.toJSON(), expected) t.end() }) }) @@ -452,7 +452,7 @@ tap.test('TraceSegment', (t) => { }) t.test('should serialize the segment with the parameters', (t) => { - t.deepEqual(webChild.toJSON(), [ + t.same(webChild.toJSON(), [ 0, 1, 'WebTransaction/NormalizedUri/*', { @@ -488,7 +488,7 @@ tap.test('TraceSegment', (t) => { trace.end() // See documentation on TraceSegment.toJSON for what goes in which field. - t.deepEqual(segment.toJSON(), [ + t.same(segment.toJSON(), [ 3, 17, 'DB/select/getSome', @@ -508,7 +508,7 @@ tap.test('TraceSegment', (t) => { segment._setExclusiveDurationInMillis(1) - t.deepEqual(segment.getAttributes(), {}) + t.same(segment.getAttributes(), {}) segment.finalize() diff --git a/test/unit/util/label-parser.test.js b/test/unit/util/label-parser.test.js index 8036666a73..b182e24c64 100644 --- a/test/unit/util/label-parser.test.js +++ b/test/unit/util/label-parser.test.js @@ -13,8 +13,8 @@ tap.test('label praser', (t) => { t.test('should pass cross-agent tests', (t) => { test_data.forEach((example) => { const result = parse(example.labelString) - t.deepEqual(result.labels.sort(by_type), example.expected.sort(by_type)) - t.deepEqual(!!result.warnings.length, example.warning) + t.same(result.labels.sort(by_type), example.expected.sort(by_type)) + t.same(!!result.warnings.length, example.warning) }) t.end() }) From 4d6467ccef78baeea615824115c4d2099c541b98 Mon Sep 17 00:00:00 2001 From: Michael Goin Date: Fri, 4 Jun 2021 09:32:26 -0700 Subject: [PATCH 05/13] Fixes remote-method tests by replacing 'includes' with 'match' for string assertions. --- test/unit/collector/remote-method.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/unit/collector/remote-method.test.js b/test/unit/collector/remote-method.test.js index 88ba55692d..1a33b22587 100644 --- a/test/unit/collector/remote-method.test.js +++ b/test/unit/collector/remote-method.test.js @@ -688,22 +688,22 @@ tap.test('when generating the User-Agent string', (t) => { }) t.test('should clearly indicate it is New Relic for Node', (t) => { - t.includes(userAgent, 'NewRelic-NodeAgent') + t.match(userAgent, 'NewRelic-NodeAgent') t.end() }) t.test('should include the agent version', (t) => { - t.includes(userAgent, TEST_VERSION) + t.match(userAgent, TEST_VERSION) t.end() }) t.test('should include node version', (t) => { - t.includes(userAgent, process.versions.node) + t.match(userAgent, process.versions.node) t.end() }) t.test('should include node platform and architecture', (t) => { - t.includes(userAgent, process.platform + '-' + process.arch) + t.match(userAgent, process.platform + '-' + process.arch) t.end() }) }) From 886a5dd0b9134d297d90cfd558d44fbe758f7b52 Mon Sep 17 00:00:00 2001 From: Michael Goin Date: Fri, 4 Jun 2021 12:44:08 -0700 Subject: [PATCH 06/13] Fixes integration tests for tap 15 compat. --- package.json | 2 +- .../agent/serverless-harvest.tap.js | 14 +- .../custom-attribute-span-propogation.tap.js | 12 +- test/integration/core/promises.js | 3 +- .../integration/distributed-tracing/dt.tap.js | 100 +++++++------ test/integration/fastify/naming.tap.js | 6 +- .../fastify/new-state-tracking.tap.js | 8 +- .../infinite-tracing-connection.tap.js | 14 +- .../instrumentation/hapi/capture-params.js | 20 ++- .../instrumentation/http-outbound.tap.js | 6 +- .../instrumentation/memcached.tap.js | 137 +++++++----------- .../instrumentation/promises/methods.js | 17 ++- test/integration/instrumentation/when.tap.js | 36 ++--- test/integration/logger.tap.js | 15 +- .../module-loading/module-loading.tap.js | 3 - .../newrelic-response-handling.tap.js | 28 ++-- .../security-policies-cross-agent.tap.js | 4 +- test/integration/shimmer/module-load.test.js | 6 +- test/smoke/agent/lasp-send-trace.tap.js | 4 +- 19 files changed, 201 insertions(+), 234 deletions(-) diff --git a/package.json b/package.json index ecc211ff91..71258dcfe5 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "ca-gen": "./bin/update-ca-bundle.sh", "docker-env": "./bin/docker-env-vars.sh", "docs": "npm ci && jsdoc -c ./jsdoc-conf.json --private -r .", - "integration": "npm run prepare-test && npm run sub-install && time tap --no-esm test/integration/**/**/*.tap.js --timeout=180 --no-coverage", + "integration": "npm run prepare-test && npm run sub-install && time tap test/integration/**/**/*.tap.js --timeout=180 --no-coverage", "prepare-test": "npm run ca-gen && npm run ssl && npm run docker-env", "lint": "eslint ./*.js lib test bin", "public-docs": "npm ci && jsdoc -c ./jsdoc-conf.json --tutorials examples/shim api.js lib/shim/ lib/transaction/handle.js && cp examples/shim/*.png out/", diff --git a/test/integration/agent/serverless-harvest.tap.js b/test/integration/agent/serverless-harvest.tap.js index 9d7e933bef..acafe62392 100644 --- a/test/integration/agent/serverless-harvest.tap.js +++ b/test/integration/agent/serverless-harvest.tap.js @@ -10,6 +10,7 @@ const helper = require('../../lib/agent_helper') const tap = require('tap') const sinon = require('sinon') const API = require('../../../api') +const util = require('util') const DESTS = require('../../../lib/config/attribute-filter').DESTINATIONS const TEST_ARN = 'test:arn' @@ -25,7 +26,7 @@ tap.test('Serverless mode harvest', (t) => { process.env.AWS_EXECUTION_ENV = TEST_EX_ENV - t.beforeEach((done) => { + t.beforeEach(async() => { logSpy = sinon.spy(fs, 'writeSync') agent = helper.instrumentMockedAgent({ serverless_mode: { @@ -37,15 +38,16 @@ tap.test('Serverless mode harvest', (t) => { agent.setLambdaArn(TEST_ARN) agent.setLambdaFunctionVersion(TEST_FUNC_VERSION) - agent.start(done) + const agentStart = util.promisify(agent.start).bind(agent) + await agentStart() }) - t.afterEach((done) => { + t.afterEach(async() => { logSpy && logSpy.restore() helper.unloadAgent(agent) - agent.stop((err) => { - done(err) - }) + + const agentStop = util.promisify(agent.stop).bind(agent) + await agentStop() }) t.test('simple harvest', (t) => { diff --git a/test/integration/api/custom-attribute-span-propogation.tap.js b/test/integration/api/custom-attribute-span-propogation.tap.js index 69a46cdf94..f0274c5e3e 100644 --- a/test/integration/api/custom-attribute-span-propogation.tap.js +++ b/test/integration/api/custom-attribute-span-propogation.tap.js @@ -19,19 +19,17 @@ tap.test('#addAttribute', (t) => { let agent = null let api = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent({ distributed_tracing: { enabled: true } }) api = new API(agent) - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should add attribute to current span', (t) => { @@ -102,19 +100,17 @@ tap.test('#addCustomSpanAttribute', (t) => { let agent = null let api = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent({ distributed_tracing: { enabled: true } }) api = new API(agent) - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should not add attribute to transaction', (t) => { diff --git a/test/integration/core/promises.js b/test/integration/core/promises.js index 4f7e9476e0..cd7a7fa806 100644 --- a/test/integration/core/promises.js +++ b/test/integration/core/promises.js @@ -15,9 +15,8 @@ var testTransactionState = require(genericTestDir + 'transaction-state') module.exports = function runTests(flags) { var RealPromise = global.Promise - tap.afterEach(function(done) { + tap.afterEach(() => { Promise = global.Promise = RealPromise - done() }) tap.test('transaction state', function(t) { diff --git a/test/integration/distributed-tracing/dt.tap.js b/test/integration/distributed-tracing/dt.tap.js index 367d1eabbf..2b3d59ade3 100644 --- a/test/integration/distributed-tracing/dt.tap.js +++ b/test/integration/distributed-tracing/dt.tap.js @@ -268,7 +268,7 @@ tap.test('distributed tracing', (t) => { t.autoend() - t.beforeEach((done) => { + t.beforeEach(async() => { agent = helper.instrumentMockedAgent({ distributed_tracing: {enabled: true}, cross_application_tracer: {enabled: true}, @@ -281,63 +281,69 @@ tap.test('distributed tracing', (t) => { const http = require('http') const api = new API(agent) - async.parallel([ - (cb) => { - start = generateServer(http, api, START_PORT, cb, (req, res) => { - const tx = agent.tracer.getTransaction() - tx.nameState.appendPath('foobar') - - get(generateUrl(MIDDLE_PORT, 'start/middle'), (err, body) => { - tx.nameState.popPath('foobar') - - body.start = req.headers - body = JSON.stringify(body) - res.setHeader('Content-Type', 'application/json') - res.setHeader('Content-Length', Buffer.byteLength(body)) - res.write(body) - res.end() + // TODO: convert to async functions to get rid of 'async' library usage. + await new Promise((resolve) => { + async.parallel([ + (cb) => { + start = generateServer(http, api, START_PORT, cb, (req, res) => { + const tx = agent.tracer.getTransaction() + tx.nameState.appendPath('foobar') + + get(generateUrl(MIDDLE_PORT, 'start/middle'), (err, body) => { + tx.nameState.popPath('foobar') + + body.start = req.headers + body = JSON.stringify(body) + res.setHeader('Content-Type', 'application/json') + res.setHeader('Content-Length', Buffer.byteLength(body)) + res.write(body) + res.end() + }) }) - }) - }, - - (cb) => { - middle = generateServer(http, api, MIDDLE_PORT, cb, (req, res) => { - const tx = agent.tracer.getTransaction() - tx.nameState.appendPath('foobar') - - get(generateUrl(END_PORT, 'middle/end'), (err, body) => { - tx.nameState.popPath('foobar') + }, + + (cb) => { + middle = generateServer(http, api, MIDDLE_PORT, cb, (req, res) => { + const tx = agent.tracer.getTransaction() + tx.nameState.appendPath('foobar') + + get(generateUrl(END_PORT, 'middle/end'), (err, body) => { + tx.nameState.popPath('foobar') + + body.middle = req.headers + body = JSON.stringify(body) + res.setHeader('Content-Type', 'application/json') + res.setHeader('Content-Length', Buffer.byteLength(body)) + res.write(body) + res.end() + }) + }) + }, - body.middle = req.headers - body = JSON.stringify(body) + (cb) => { + end = generateServer(http, api, END_PORT, cb, (req, res) => { + const body = JSON.stringify({end: req.headers}) res.setHeader('Content-Type', 'application/json') res.setHeader('Content-Length', Buffer.byteLength(body)) res.write(body) res.end() }) - }) - }, - - (cb) => { - end = generateServer(http, api, END_PORT, cb, (req, res) => { - const body = JSON.stringify({end: req.headers}) - res.setHeader('Content-Type', 'application/json') - res.setHeader('Content-Length', Buffer.byteLength(body)) - res.write(body) - res.end() - }) - } - ], done) + } + ], resolve) + }) }) - t.afterEach((done) => { + // TODO: convert to async functions to get rid of 'async' library usage. + t.afterEach(async() => { helper.unloadAgent(agent) - async.parallel([ - (cb) => start.close(cb), - (cb) => middle.close(cb), - (cb) => end.close(cb), - ], done) + await new Promise((resolve) => { + async.parallel([ + (cb) => start.close(cb), + (cb) => middle.close(cb), + (cb) => end.close(cb), + ], resolve) + }) }) t.test('should create tracing headers at each step', (t) => { diff --git a/test/integration/fastify/naming.tap.js b/test/integration/fastify/naming.tap.js index de10007d07..35acb1b13a 100644 --- a/test/integration/fastify/naming.tap.js +++ b/test/integration/fastify/naming.tap.js @@ -99,7 +99,7 @@ tap.test('Test Transaction Naming', (test) => { let agent let fastify - test.beforeEach(async(done) => { + test.beforeEach(async() => { agent = helper.instrumentMockedAgent({ feature_flag: { fastify_instrumentation: true @@ -107,13 +107,11 @@ tap.test('Test Transaction Naming', (test) => { }) fastify = require('fastify')() await configureFastifyServer(fastify) - done() }) - test.afterEach((done) => { + test.afterEach(() => { helper.unloadAgent(agent) fastify.close() - done() }) for (const [,uri] of routesToTest.entries()) { diff --git a/test/integration/fastify/new-state-tracking.tap.js b/test/integration/fastify/new-state-tracking.tap.js index af107be479..18bf2704f5 100644 --- a/test/integration/fastify/new-state-tracking.tap.js +++ b/test/integration/fastify/new-state-tracking.tap.js @@ -18,7 +18,7 @@ tap.test('fastify with new state tracking', (t) => { let agent = null let fastify = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent({ feature_flag: { fastify_instrumentation: true, @@ -27,15 +27,11 @@ tap.test('fastify with new state tracking', (t) => { }) fastify = require('fastify')() - - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) fastify.close() - - done() }) t.test('should not reuse transactions via normal usage', async(t) => { diff --git a/test/integration/infinite-tracing-connection.tap.js b/test/integration/infinite-tracing-connection.tap.js index 0cdf3d33c7..265fb74e9a 100644 --- a/test/integration/infinite-tracing-connection.tap.js +++ b/test/integration/infinite-tracing-connection.tap.js @@ -50,9 +50,13 @@ tap.test('Inifinite tracing - Connection Handling', (t) => { let startingEndpoints = null let spanReceivedListener = null - t.beforeEach(testSetup) + t.beforeEach(async(t) => { + await new Promise((resolve) => { + testSetup(t, resolve) + }) + }) - t.afterEach((done) => { + t.afterEach(async() => { helper.unloadAgent(agent) if (!nock.isDone()) { @@ -64,8 +68,8 @@ tap.test('Inifinite tracing - Connection Handling', (t) => { nock.enableNetConnect() - server.tryShutdown(() => { - done() + await new Promise((resolve) => { + server.tryShutdown(resolve) }) }) @@ -177,7 +181,7 @@ tap.test('Inifinite tracing - Connection Handling', (t) => { }) }) - function testSetup(callback, t) { + function testSetup(t, callback) { nock.disableNetConnect() startingEndpoints = setupConnectionEndpoints(INITIAL_RUN_ID, INITIAL_SESSION_ID) diff --git a/test/integration/instrumentation/hapi/capture-params.js b/test/integration/instrumentation/hapi/capture-params.js index 4b3ee2bff5..58ea79718c 100644 --- a/test/integration/instrumentation/hapi/capture-params.js +++ b/test/integration/instrumentation/hapi/capture-params.js @@ -5,13 +5,15 @@ 'use strict' +// TODO: this only seems used by hapi-pre-17 now. confirm and move code directly in there. +// If used in multiple places but only versioned, move under versioned hapi folder. + var DESTINATIONS = require('../../../../lib/config/attribute-filter').DESTINATIONS var helper = require('../../../lib/agent_helper') var HTTP_ATTRS = require('../../../lib/fixtures').httpAttributes var request = require('request') var tap = require('tap') - module.exports = runTests function runTests(createServer) { @@ -22,7 +24,7 @@ function runTests(createServer) { var server = null var port = null - t.beforeEach(function(done) { + t.beforeEach(() => { agent = helper.instrumentMockedAgent({ allow_all_headers: false, attributes: { @@ -32,12 +34,20 @@ function runTests(createServer) { }) server = createServer() - done() }) - t.afterEach(function(done) { + t.afterEach(async() => { helper.unloadAgent(agent) - server.stop(done) + + await new Promise((resolve, reject) => { + server.stop((err) => { + if (err) { + return reject(err) + } + + resolve() + }) + }) }) t.test("simple case with no params", function(t) { diff --git a/test/integration/instrumentation/http-outbound.tap.js b/test/integration/instrumentation/http-outbound.tap.js index 28d063a8e9..5911d5ea39 100644 --- a/test/integration/instrumentation/http-outbound.tap.js +++ b/test/integration/instrumentation/http-outbound.tap.js @@ -14,15 +14,13 @@ tap.test('external requests', function(t) { let agent = null let http = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent() http = require('http') - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('segments should end on error', function(t) { diff --git a/test/integration/instrumentation/memcached.tap.js b/test/integration/instrumentation/memcached.tap.js index 9b35ca96c7..a6a48260bc 100644 --- a/test/integration/instrumentation/memcached.tap.js +++ b/test/integration/instrumentation/memcached.tap.js @@ -13,6 +13,7 @@ var findSegment = require('../../lib/metrics_helper').findSegment var getMetricHostName = require('../../lib/metrics_helper').getMetricHostName var util = require('util') +const bootstrapMemcached = util.promisify(helper.bootstrapMemcached) var METRICS_ASSERTIONS = 10 @@ -27,27 +28,21 @@ test('memcached instrumentation', {timeout : 5000}, function(t) { t.test('generates correct metrics and trace segments', function(t) { t.autoend() - t.beforeEach(function(done) { - helper.bootstrapMemcached(function cb_bootstrapMemcached(error) { - if (error) { - return done(error) - } - agent = helper.instrumentMockedAgent() + t.beforeEach(async() => { + await bootstrapMemcached() - Memcached = require('memcached') - memcached = new Memcached(params.memcached_host + ':' + params.memcached_port) + agent = helper.instrumentMockedAgent() - var hostName = getMetricHostName(agent, params.memcached_host) - HOST_ID = hostName + '/' + params.memcached_port + Memcached = require('memcached') + memcached = new Memcached(params.memcached_host + ':' + params.memcached_port) - done() - }) + var hostName = getMetricHostName(agent, params.memcached_host) + HOST_ID = hostName + '/' + params.memcached_port }) - t.afterEach(function(done) { - helper.unloadAgent(agent) - memcached.end() - done() + t.afterEach(() => { + agent && helper.unloadAgent(agent) + memcached && memcached.end() }) t.test('touch()', function(t) { @@ -443,26 +438,21 @@ test('memcached instrumentation', {timeout : 5000}, function(t) { t.test('captures attributes', function(t) { t.autoend() - t.beforeEach(function(done) { - helper.bootstrapMemcached(function cb_bootstrapMemcached(error) { - if (error) { - return done(error) - } - agent = helper.instrumentMockedAgent() + t.beforeEach(async() => { + await bootstrapMemcached() - // capture attributes - agent.config.attributes.enabled = true + agent = helper.instrumentMockedAgent() - Memcached = require('memcached') - memcached = new Memcached(params.memcached_host + ':' + params.memcached_port) - done() - }) + // capture attributes + agent.config.attributes.enabled = true + + Memcached = require('memcached') + memcached = new Memcached(params.memcached_host + ':' + params.memcached_port) }) - t.afterEach(function(done) { + t.afterEach(() => { helper.unloadAgent(agent) memcached.end() - done() }) t.test('get()', function(t) { @@ -541,23 +531,18 @@ test('memcached instrumentation', {timeout : 5000}, function(t) { t.test('captures datastore instance attributes', function(t) { t.autoend() - t.beforeEach(function(done) { - helper.bootstrapMemcached(function cb_bootstrapMemcached(error) { - if (error) { - return done(error) - } - agent = helper.instrumentMockedAgent() + t.beforeEach(async() => { + await bootstrapMemcached() - Memcached = require('memcached') - memcached = new Memcached(params.memcached_host + ':' + params.memcached_port) - done() - }) + agent = helper.instrumentMockedAgent() + + Memcached = require('memcached') + memcached = new Memcached(params.memcached_host + ':' + params.memcached_port) }) - t.afterEach(function(done) { + t.afterEach(() => { helper.unloadAgent(agent) memcached.end() - done() }) t.test('get()', function(t) { @@ -620,26 +605,21 @@ test('memcached instrumentation', {timeout : 5000}, function(t) { t.test('does not capture datastore instance attributes when disabled', function(t) { t.autoend() - t.beforeEach(function(done) { - helper.bootstrapMemcached(function cb_bootstrapMemcached(error) { - if (error) { - return done(error) - } - agent = helper.instrumentMockedAgent() + t.beforeEach(async() => { + await bootstrapMemcached() - // disable - agent.config.datastore_tracer.instance_reporting.enabled = false + agent = helper.instrumentMockedAgent() - Memcached = require('memcached') - memcached = new Memcached(params.memcached_host + ':' + params.memcached_port) - done() - }) + // disable + agent.config.datastore_tracer.instance_reporting.enabled = false + + Memcached = require('memcached') + memcached = new Memcached(params.memcached_host + ':' + params.memcached_port) }) - t.afterEach(function(done) { + t.afterEach(() => { helper.unloadAgent(agent) memcached.end() - done() }) t.test('get()', function(t) { @@ -704,43 +684,34 @@ test('memcached instrumentation', {timeout : 5000}, function(t) { var origCommand = null var realServer = params.memcached_host + ':' + params.memcached_port - t.beforeEach(function(done) { - helper.bootstrapMemcached(function(error) { - if (error) { - return done(error) - } - - // Load memcached and replace the command func with our own that will - // use a real server address. - Memcached = require('memcached') - origCommand = Memcached.prototype.command - /* eslint-disable no-unused-vars */ - Memcached.prototype.command = function stubbedCommand(queryCompiler, server) { - /* eslint-enable no-unused-vars */ - origCommand.call(this, queryCompiler, realServer) - } + t.beforeEach(async() => { + await bootstrapMemcached() - // Then load the agent and reload memcached to ensure it gets instrumented. - agent = helper.instrumentMockedAgent() - Memcached = require('memcached') - memcached = new Memcached(['server1:1111', 'server2:2222']) + Memcached = require('memcached') + origCommand = Memcached.prototype.command + /* eslint-disable no-unused-vars */ + Memcached.prototype.command = function stubbedCommand(queryCompiler, server) { + /* eslint-enable no-unused-vars */ + origCommand.call(this, queryCompiler, realServer) + } - // Finally, change the hashring to something controllable. - memcached.HashRing.get = function(key) { - return key === 'foo' ? 'server1:1111' : 'server2:2222' - } + // Then load the agent and reload memcached to ensure it gets instrumented. + agent = helper.instrumentMockedAgent() + Memcached = require('memcached') + memcached = new Memcached(['server1:1111', 'server2:2222']) - done() - }) + // Finally, change the hashring to something controllable. + memcached.HashRing.get = function(key) { + return key === 'foo' ? 'server1:1111' : 'server2:2222' + } }) - t.afterEach(function(done) { + t.afterEach(() => { helper.unloadAgent(agent) memcached.end() if (origCommand) { Memcached.prototype.command = origCommand } - done() }) function checkParams(segment, host, port) { diff --git a/test/integration/instrumentation/promises/methods.js b/test/integration/instrumentation/promises/methods.js index a2cc115fe0..6fdabe2286 100644 --- a/test/integration/instrumentation/promises/methods.js +++ b/test/integration/instrumentation/promises/methods.js @@ -5,20 +5,25 @@ 'use strict' +// TODO: seems like this may only be ran by the bluebird versioned test methods.tap.js +// Confirm and move logic there, if true. If used by multiple but only versioned, +// move under versioned folder. + var helper = require('../../../lib/agent_helper') var testTransactionState = require('./transaction-state') - +const util = require('util') var runMultiple = testTransactionState.runMultiple var tasks = [] var interval = null +const setImmediatePromisified = util.promisify(setImmediate) module.exports = function(t, library, loadLibrary) { loadLibrary = loadLibrary || function() { return require(library) } var ptap = new PromiseTap(t, loadLibrary()) - t.beforeEach(function(done) { + t.beforeEach(async() => { if (interval) { clearInterval(interval) } @@ -27,13 +32,15 @@ module.exports = function(t, library, loadLibrary) { tasks.pop()() } }, 25) - setImmediate(done) + + await setImmediatePromisified() }) - t.afterEach(function(done) { + t.afterEach(async() => { clearInterval(interval) interval = null - setImmediate(done) + + await setImmediatePromisified() }) ptap.test('new Promise() throw', function(t) { diff --git a/test/integration/instrumentation/when.tap.js b/test/integration/instrumentation/when.tap.js index 855128bcac..8a49284de6 100644 --- a/test/integration/instrumentation/when.tap.js +++ b/test/integration/instrumentation/when.tap.js @@ -587,19 +587,17 @@ test('all', function(t) { var agent, when, Promise var p1, p2 - t.beforeEach(function(done) { + t.beforeEach(() => { agent = helper.instrumentMockedAgent({feature_flag: {promise_segments: false}}) when = require('when') Promise = when.Promise p1 = new Promise(function(resolve) { resolve(1) }) p2 = new Promise(function(resolve) { resolve(2) }) - done() }) - t.afterEach(function(done) { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('on library', function(t) { @@ -625,16 +623,14 @@ test('any', function(t) { t.autoend() var agent, when, Promise - t.beforeEach(function(done) { + t.beforeEach(() => { agent = helper.instrumentMockedAgent({feature_flag: {promise_segments: false}}) when = require('when') Promise = when.Promise - done() }) - t.afterEach(function(done) { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('on library', function(t) { @@ -668,16 +664,14 @@ test('some', function(t) { t.autoend() var agent, when, Promise - t.beforeEach(function(done) { + t.beforeEach(() => { agent = helper.instrumentMockedAgent({feature_flag: {promise_segments: false}}) when = require('when') Promise = when.Promise - done() }) - t.afterEach(function(done) { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('on library', function(t) { @@ -717,16 +711,14 @@ test('map', function(t) { t.autoend() var agent, when, Promise - t.beforeEach(function(done) { + t.beforeEach(() => { agent = helper.instrumentMockedAgent({feature_flag: {promise_segments: false}}) when = require('when') Promise = when.Promise - done() }) - t.afterEach(function(done) { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('on library', function(t) { @@ -762,16 +754,14 @@ test('reduce', function(t) { t.autoend() var agent, when, Promise - t.beforeEach(function(done) { + t.beforeEach(() => { agent = helper.instrumentMockedAgent({feature_flag: {promise_segments: false}}) when = require('when') Promise = when.Promise - done() }) - t.afterEach(function(done) { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('on library', function(t) { @@ -807,16 +797,14 @@ test('filter', function(t) { t.autoend() var agent, when, Promise - t.beforeEach(function(done) { + t.beforeEach(() => { agent = helper.instrumentMockedAgent({feature_flag: {promise_segments: false}}) when = require('when') Promise = when.Promise - done() }) - t.afterEach(function(done) { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('on library', function(t) { diff --git a/test/integration/logger.tap.js b/test/integration/logger.tap.js index e8190e128d..57a2d18e63 100644 --- a/test/integration/logger.tap.js +++ b/test/integration/logger.tap.js @@ -16,17 +16,20 @@ var DIRNAME = 'XXXNOCONFTEST' tap.test('logger', function(t) { t.autoend() - t.afterEach(function(done) { + t.afterEach(async() => { if (path.basename(process.cwd()) === DIRNAME) { process.chdir('..') } var dirPath = path.join(process.cwd(), DIRNAME) - if (fs.existsSync(dirPath)) { - rimraf(dirPath, done) - } else { - done() - } + + await new Promise((resolve) => { + if (fs.existsSync(dirPath)) { + rimraf(dirPath, resolve) + } else { + resolve() + } + }) }) t.test('configuration from environment', function(t) { diff --git a/test/integration/module-loading/module-loading.tap.js b/test/integration/module-loading/module-loading.tap.js index b481e8bd3e..8a47e3154c 100644 --- a/test/integration/module-loading/module-loading.tap.js +++ b/test/integration/module-loading/module-loading.tap.js @@ -43,9 +43,6 @@ tap.test('Should properly track module paths to enable shim.require()', function t.equal(shimLoadedCustom.name, 'customFunction', 'Should grab correct module') }) - -// This test requires the --no-esm flag for tap -// to run in a way it will trigger the failure. tap.test('shim.require() should play well with multiple test runs', (t) => { simulateTestLoadAndUnload() diff --git a/test/integration/newrelic-response-handling.tap.js b/test/integration/newrelic-response-handling.tap.js index a6a323b33a..2e60ed0ac3 100644 --- a/test/integration/newrelic-response-handling.tap.js +++ b/test/integration/newrelic-response-handling.tap.js @@ -64,7 +64,7 @@ function createStatusCodeTest(testCase) { let agent = null - statusCodeTest.beforeEach((done) => { + statusCodeTest.beforeEach(async() => { nock.disableNetConnect() testClock = sinon.useFakeTimers({ @@ -94,12 +94,12 @@ function createStatusCodeTest(testCase) { // We don't want any harvests before our manually triggered harvest agent.config.no_immediate_harvest = true - createTestData(agent, () => { - done() + await new Promise((resolve) => { + createTestData(agent, resolve) }) }) - statusCodeTest.afterEach((done) => { + statusCodeTest.afterEach(() => { helper.unloadAgent(agent) agent = null testClock.restore() @@ -114,8 +114,6 @@ function createStatusCodeTest(testCase) { } nock.enableNetConnect() - - done() }) // Test behavior for this status code against every endpoint @@ -169,7 +167,7 @@ function createStatusCodeTest(testCase) { verifyRunBehavior() verifyDataRetention() - subTest.done() + subTest.end() }) }) @@ -230,7 +228,7 @@ function whenAllAggregatorsSend(agent) { } ) }) - + const spanPromise = new Promise((resolve) => { agent.spanEventAggregator.once( 'finished span_event_data data send.', @@ -295,13 +293,13 @@ function whenAllAggregatorsSend(agent) { }) const promises = [ - metricPromise, - spanPromise, - customEventPromise, - transactionEventPromise, - transactionTracePromise, - sqlTracePromise, - errorTracePromise, + metricPromise, + spanPromise, + customEventPromise, + transactionEventPromise, + transactionTracePromise, + sqlTracePromise, + errorTracePromise, errorEventPromise ] diff --git a/test/integration/security-policies-cross-agent.tap.js b/test/integration/security-policies-cross-agent.tap.js index d981eddbf8..9e8bf29d9f 100644 --- a/test/integration/security-policies-cross-agent.tap.js +++ b/test/integration/security-policies-cross-agent.tap.js @@ -75,7 +75,7 @@ tap.test('LASP/CSP - Cross Agent Tests', (t) => { } } - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null preconnect = null @@ -88,8 +88,6 @@ tap.test('LASP/CSP - Cross Agent Tests', (t) => { } nock.enableNetConnect() - - done() }) testCases.forEach((testCase) => { diff --git a/test/integration/shimmer/module-load.test.js b/test/integration/shimmer/module-load.test.js index 4ecf3eb0d0..08214a58a7 100644 --- a/test/integration/shimmer/module-load.test.js +++ b/test/integration/shimmer/module-load.test.js @@ -13,15 +13,13 @@ tap.test('Test Module Instrumentation Loading', (t) => { t.autoend() let agent = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.loadMockedAgent() - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) agent = null - done() }) t.test("__NR_instrumented set correctly", (t) => { diff --git a/test/smoke/agent/lasp-send-trace.tap.js b/test/smoke/agent/lasp-send-trace.tap.js index 412172d288..8bf1e6c4ad 100644 --- a/test/smoke/agent/lasp-send-trace.tap.js +++ b/test/smoke/agent/lasp-send-trace.tap.js @@ -17,7 +17,7 @@ tap.test('LASP-enabled agent', (t) => { let api = null let config = null - t.beforeEach(function(done) { + t.beforeEach(function() { config = configurator.initialize({ app_name: 'node.js Tests', license_key: license, @@ -41,8 +41,6 @@ tap.test('LASP-enabled agent', (t) => { // Agent cannot create transactions from initial 'stopped' state agent.setState('started') - - done() }) t.test('drops full trace if custom attributes are disabled by LASP', function(t) { From ff59e932425d6cb748ffed74feded71a9965cf2c Mon Sep 17 00:00:00 2001 From: Bob Evans Date: Fri, 4 Jun 2021 15:33:35 -0400 Subject: [PATCH 07/13] updated versioned tests to support tap 15 --- .../collector-remote-method.tap.js | 4 +- test/integration/config/attribute-cat.tap.js | 2 +- .../core/async_hooks-new-promise.js | 12 +- test/integration/core/async_hooks.js | 8 +- test/integration/core/child_process.tap.js | 2 +- test/integration/core/crypto.tap.js | 2 +- test/integration/core/dns.tap.js | 2 +- test/integration/core/fs.tap.js | 6 +- test/integration/core/inspector.tap.js | 2 +- test/integration/core/net.tap.js | 4 +- test/integration/core/promises.js | 4 +- test/integration/core/timers.tap.js | 2 +- test/integration/core/util.tap.js | 10 +- test/integration/core/zlib.tap.js | 2 +- .../integration/distributed-tracing/dt.tap.js | 4 +- .../span-error-attributes.tap.js | 4 +- .../transaction-span-attributes.tap.js | 2 +- test/integration/fastify/errors.tap.js | 2 +- test/integration/grpc/reconnect.tap.js | 2 +- .../instrumentation/http-outbound.tap.js | 4 +- .../instrumentation/http-rum.tap.js | 4 +- test/integration/instrumentation/http.tap.js | 10 +- .../integration/instrumentation/oracle.tap.js | 2 +- .../instrumentation/promises/methods.js | 6 +- .../instrumentation/promises/regressions.js | 2 +- test/integration/instrumentation/q.tap.js | 2 +- .../instrumentation/restify.tap.js | 6 +- test/integration/instrumentation/when.tap.js | 4 +- test/integration/keep-alive.tap.js | 2 +- .../module-loading/module-loading.tap.js | 4 +- test/integration/pricing/docker-info.tap.js | 6 +- test/integration/pricing/pcf-info.tap.js | 2 +- test/integration/pricing/system-info.tap.js | 12 +- test/integration/pricing/vendor-info-tests.js | 4 +- .../integration/transaction/total-time.tap.js | 2 +- .../trace-async-propagation.tap.js | 24 ++-- .../uninstrumented/uninstrumented.tap.js | 4 +- test/lib/agent_helper.js | 4 +- test/versioned/amqplib/callback.tap.js | 26 ++-- test/versioned/amqplib/promises.tap.js | 11 +- .../bluebird/transaction-state.tap.js | 2 +- test/versioned/cassandra-driver/query.tap.js | 2 +- test/versioned/cls/cls.tap.js | 2 +- test/versioned/connect/error-intercept.tap.js | 6 +- test/versioned/director/director.tap.js | 10 +- test/versioned/express/app-use.tap.js | 6 +- test/versioned/express/bare-router.tap.js | 2 +- test/versioned/express/captures-params.tap.js | 18 ++- test/versioned/express/errors.tap.js | 6 +- .../versioned/express/express-enrouten.tap.js | 2 +- test/versioned/express/ignoring.tap.js | 2 +- test/versioned/express/middleware-name.tap.js | 2 +- test/versioned/express/render.tap.js | 27 ++--- test/versioned/express/route-iteration.tap.js | 2 +- test/versioned/express/route-param.tap.js | 2 +- test/versioned/express/router-params.tap.js | 2 +- test/versioned/express/segments.tap.js | 4 +- .../express/transaction-naming.tap.js | 14 +-- test/versioned/generic-pool/basic-v2.tap.js | 8 +- test/versioned/generic-pool/basic.tap.js | 8 +- .../hapi/hapi-17/capture-params.tap.js | 3 +- test/versioned/hapi/hapi-17/errors.tap.js | 5 +- test/versioned/hapi/hapi-17/ext.tap.js | 5 +- test/versioned/hapi/hapi-17/ignoring.tap.js | 2 +- test/versioned/hapi/hapi-17/plugins.tap.js | 5 +- test/versioned/hapi/hapi-17/render.tap.js | 7 +- test/versioned/hapi/hapi-17/router.tap.js | 4 +- test/versioned/hapi/hapi-17/segments.tap.js | 3 +- test/versioned/hapi/hapi-17/vhost.tap.js | 2 +- .../hapi/hapi-post-18/capture-params.tap.js | 3 +- .../versioned/hapi/hapi-post-18/errors.tap.js | 5 +- test/versioned/hapi/hapi-post-18/ext.tap.js | 5 +- .../hapi/hapi-post-18/ignoring.tap.js | 2 +- .../hapi/hapi-post-18/plugins.tap.js | 5 +- .../versioned/hapi/hapi-post-18/render.tap.js | 5 +- .../versioned/hapi/hapi-post-18/router.tap.js | 4 +- .../hapi/hapi-post-18/segments.tap.js | 3 +- test/versioned/hapi/hapi-post-18/vhost.tap.js | 2 +- test/versioned/hapi/hapi-pre-17/errors.tap.js | 7 +- .../versioned/hapi/hapi-pre-17/ext-v16.tap.js | 9 +- .../hapi/hapi-pre-17/ignoring.tap.js | 2 +- .../hapi/hapi-pre-17/plugins-v16.tap.js | 9 +- .../hapi/hapi-pre-17/render-v6.tap.js | 8 +- .../hapi/hapi-pre-17/render-v7.tap.js | 8 +- .../hapi/hapi-pre-17/render-v9.tap.js | 10 +- test/versioned/hapi/hapi-pre-17/render.tap.js | 8 +- .../hapi/hapi-pre-17/router-v16.tap.js | 8 +- test/versioned/hapi/hapi-pre-17/router.tap.js | 8 +- .../hapi/hapi-pre-17/segments-v16.tap.js | 7 +- test/versioned/hapi/hapi-pre-17/vhost.tap.js | 2 +- test/versioned/ioredis/ioredis-3.tap.js | 58 +++++---- test/versioned/ioredis/ioredis.tap.js | 54 +++++---- test/versioned/mongodb/collection-common.js | 112 ++++++++---------- test/versioned/mongodb/common.js | 78 ++++++------ test/versioned/mongodb/cursor.tap.js | 29 ++--- test/versioned/mongodb/db.tap.js | 31 +++-- test/versioned/mysql/basic-pool.tap.js | 40 +++---- test/versioned/mysql/basic.tap.js | 16 +-- test/versioned/mysql/pooling.tap.js | 5 +- test/versioned/mysql/setup.js | 6 +- test/versioned/mysql/transactions.tap.js | 8 +- test/versioned/mysql2/basic-pool.tap.js | 40 +++---- test/versioned/mysql2/basic.tap.js | 16 +-- test/versioned/mysql2/pooling.tap.js | 5 +- test/versioned/mysql2/setup.js | 6 +- test/versioned/mysql2/transaction.tap.js | 8 +- test/versioned/pg/pg-post-7/pg.common.js | 66 +++++------ test/versioned/pg/pg-pre-7/pg.common.js | 82 +++++++------ test/versioned/redis/redis.tap.js | 47 ++++---- .../restify-post-7/capture-params.tap.js | 15 +-- .../restify/restify-post-7/ignoring.tap.js | 2 +- .../restify/restify-post-7/restify.tap.js | 10 +- .../restify/restify-post-7/router.tap.js | 15 +-- .../restify/restify-post-7/rum.tap.js | 2 +- .../restify-post-7/transaction-naming.tap.js | 19 +-- .../restify-post-7/with-express.tap.js | 2 +- .../restify-pre-7/capture-params.tap.js | 15 +-- .../restify/restify-pre-7/ignoring.tap.js | 2 +- .../restify/restify-pre-7/restify.tap.js | 10 +- .../restify/restify-pre-7/router.tap.js | 13 +- .../restify/restify-pre-7/rum.tap.js | 2 +- .../restify-pre-7/transaction-naming.tap.js | 19 +-- .../restify/restify-pre-7/with-express.tap.js | 2 +- 123 files changed, 634 insertions(+), 701 deletions(-) diff --git a/test/integration/collector-remote-method.tap.js b/test/integration/collector-remote-method.tap.js index de7b97e550..ceea84b47c 100644 --- a/test/integration/collector-remote-method.tap.js +++ b/test/integration/collector-remote-method.tap.js @@ -43,7 +43,7 @@ tap.test('DataSender (callback style) talking to fake collector', (t) => { return t.end() } - t.tearDown(() => { + t.teardown(() => { server.close() }) @@ -125,7 +125,7 @@ tap.test('remote method to preconnect', (t) => { startedCallback(err, this) }) - t.tearDown(() => { + t.teardown(() => { server.close() }) diff --git a/test/integration/config/attribute-cat.tap.js b/test/integration/config/attribute-cat.tap.js index 1c71f84ef1..2462c41867 100644 --- a/test/integration/config/attribute-cat.tap.js +++ b/test/integration/config/attribute-cat.tap.js @@ -34,7 +34,7 @@ tap.test('Attribute include/exclude configurations', function(t) { t.plan(tests.length) var agent = helper.loadMockedAgent() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) diff --git a/test/integration/core/async_hooks-new-promise.js b/test/integration/core/async_hooks-new-promise.js index 043d9424ba..ba39df3879 100644 --- a/test/integration/core/async_hooks-new-promise.js +++ b/test/integration/core/async_hooks-new-promise.js @@ -143,7 +143,7 @@ test("the agent's async hook", function(t) { } }, 10) - t.tearDown(() => { + t.teardown(() => { clearInterval(intervalId) }) @@ -180,7 +180,7 @@ test("the agent's async hook", function(t) { } }, 10) - t.tearDown(() => { + t.teardown(() => { clearInterval(intervalId) }) @@ -221,7 +221,7 @@ test("the agent's async hook", function(t) { } }, 10) - t.tearDown(() => { + t.teardown(() => { clearInterval(intervalId) }) @@ -286,7 +286,7 @@ test("the agent's async hook", function(t) { } }, 10) - t.tearDown(() => { + t.teardown(() => { clearInterval(intervalId) }) @@ -381,7 +381,7 @@ test("the agent's async hook", function(t) { } }, 10) - t.tearDown(() => { + t.teardown(() => { clearInterval(intervalId) }) @@ -582,7 +582,7 @@ function setupAgent(t) { const agent = helper.instrumentMockedAgent({ feature_flag: {await_support: true} }) - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) diff --git a/test/integration/core/async_hooks.js b/test/integration/core/async_hooks.js index 0e5b68bc78..f41c17134c 100644 --- a/test/integration/core/async_hooks.js +++ b/test/integration/core/async_hooks.js @@ -132,7 +132,7 @@ test("the agent's async hook", function(t) { } }, 10) - t.tearDown(() => { + t.teardown(() => { clearInterval(intervalId) }) @@ -160,7 +160,7 @@ test("the agent's async hook", function(t) { } }, 10) - t.tearDown(() => { + t.teardown(() => { clearInterval(intervalId) }) @@ -244,7 +244,7 @@ test("the agent's async hook", function(t) { } }, 10) - t.tearDown(() => { + t.teardown(() => { clearInterval(intervalId) }) @@ -419,7 +419,7 @@ function setupAgent(t) { var agent = helper.instrumentMockedAgent({ feature_flag: {await_support: true} }) - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) diff --git a/test/integration/core/child_process.tap.js b/test/integration/core/child_process.tap.js index 8158b228c9..c36247b2b6 100644 --- a/test/integration/core/child_process.tap.js +++ b/test/integration/core/child_process.tap.js @@ -307,7 +307,7 @@ test('should not break removeAllListeners', (t) => { function setupAgent(t) { var agent = helper.instrumentMockedAgent() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) diff --git a/test/integration/core/crypto.tap.js b/test/integration/core/crypto.tap.js index 1357675251..874b639bd1 100644 --- a/test/integration/core/crypto.tap.js +++ b/test/integration/core/crypto.tap.js @@ -126,7 +126,7 @@ test('scryptSync', (t) => { function setupAgent(t) { var agent = helper.instrumentMockedAgent() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) diff --git a/test/integration/core/dns.tap.js b/test/integration/core/dns.tap.js index afb2be0177..3b14325cf7 100644 --- a/test/integration/core/dns.tap.js +++ b/test/integration/core/dns.tap.js @@ -142,7 +142,7 @@ test('reverse', function(t) { function setupAgent(t) { var agent = helper.instrumentMockedAgent() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) diff --git a/test/integration/core/fs.tap.js b/test/integration/core/fs.tap.js index a5e0ee8219..424616944f 100644 --- a/test/integration/core/fs.tap.js +++ b/test/integration/core/fs.tap.js @@ -38,7 +38,7 @@ function test(title, options, callback) { } options.timeout = 15000 // Allow for a slow file system. tapTest(title, options, function(t) { - t.tearDown(function() { + t.teardown(function() { if (++done === tasks) { process.umask(mask) } @@ -938,8 +938,8 @@ test('watchFile', function(t) { }) function setupAgent(t) { - const agent = helper.instrumentMockedAgent() - t.tearDown(function() { + var agent = helper.instrumentMockedAgent() + t.teardown(function() { helper.unloadAgent(agent) }) diff --git a/test/integration/core/inspector.tap.js b/test/integration/core/inspector.tap.js index 43f7c3d026..f167a41c52 100644 --- a/test/integration/core/inspector.tap.js +++ b/test/integration/core/inspector.tap.js @@ -37,7 +37,7 @@ test('inspector', function(t) { function setupAgent(t) { var agent = helper.instrumentMockedAgent() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) diff --git a/test/integration/core/net.tap.js b/test/integration/core/net.tap.js index bcd0774b8d..f7c4ce097f 100644 --- a/test/integration/core/net.tap.js +++ b/test/integration/core/net.tap.js @@ -86,7 +86,7 @@ test('connect', function connectTest(t) { }) }) - t.tearDown(function() { + t.teardown(function() { server.close() }) @@ -250,7 +250,7 @@ test('createServer and connect', function createServerTest(t) { function setupAgent(t) { var agent = helper.instrumentMockedAgent() - t.tearDown(function tearDown() { + t.teardown(function tearDown() { helper.unloadAgent(agent) }) return agent diff --git a/test/integration/core/promises.js b/test/integration/core/promises.js index cd7a7fa806..1bc74cb5b0 100644 --- a/test/integration/core/promises.js +++ b/test/integration/core/promises.js @@ -1055,7 +1055,7 @@ module.exports = function runTests(flags) { } var agent = helper.loadTestAgent(t, {feature_flag: flags}) - t.tearDown(function() { + t.teardown(function() { global.Promise = OriginalPromise }) @@ -1077,7 +1077,7 @@ module.exports = function runTests(flags) { util.inherits(WrappedPromise, Promise) global.Promise = WrappedPromise - t.tearDown(function() { + t.teardown(function() { global.Promise = OriginalPromise }) diff --git a/test/integration/core/timers.tap.js b/test/integration/core/timers.tap.js index 1c4d19b364..5b09b7f3e8 100644 --- a/test/integration/core/timers.tap.js +++ b/test/integration/core/timers.tap.js @@ -246,7 +246,7 @@ tap.test('clearTimeout', function testNextTick(t) { function setupAgent(t) { var agent = helper.instrumentMockedAgent() - t.tearDown(function tearDown() { + t.teardown(function tearDown() { helper.unloadAgent(agent) }) diff --git a/test/integration/core/util.tap.js b/test/integration/core/util.tap.js index 3b92a959b4..a2218fa37f 100644 --- a/test/integration/core/util.tap.js +++ b/test/integration/core/util.tap.js @@ -15,7 +15,7 @@ test('promisify', {skip: !util.promisify}, function(t) { t.test('should work on setTimeout', function(t) { t.plan(2) var agent = helper.instrumentMockedAgent() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) let asyncTimeout = util.promisify(setTimeout) @@ -32,7 +32,7 @@ test('promisify', {skip: !util.promisify}, function(t) { t.test('should work on setImmediate', function(t) { t.plan(2) var agent = helper.instrumentMockedAgent() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) let asyncImmediate = util.promisify(setImmediate) @@ -49,7 +49,7 @@ test('promisify', {skip: !util.promisify}, function(t) { t.test('should work on child_process.exec', function(t) { t.plan(3) var agent = helper.instrumentMockedAgent() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) let asyncExec = util.promisify(require('child_process').exec) @@ -66,7 +66,7 @@ test('promisify', {skip: !util.promisify}, function(t) { t.test('should work on child_process.execFile', function(t) { t.plan(3) var agent = helper.instrumentMockedAgent() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) let asyncExec = util.promisify(require('child_process').execFile) @@ -85,7 +85,7 @@ test('promisify', {skip: !util.promisify}, function(t) { t.plan(1) var agent = helper.instrumentMockedAgent() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) diff --git a/test/integration/core/zlib.tap.js b/test/integration/core/zlib.tap.js index 4f30c6e623..78633cdf8c 100644 --- a/test/integration/core/zlib.tap.js +++ b/test/integration/core/zlib.tap.js @@ -164,7 +164,7 @@ function testStream(t, method, src, out) { function setupAgent(t) { var agent = helper.instrumentMockedAgent() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) diff --git a/test/integration/distributed-tracing/dt.tap.js b/test/integration/distributed-tracing/dt.tap.js index 2b3d59ade3..75f202580f 100644 --- a/test/integration/distributed-tracing/dt.tap.js +++ b/test/integration/distributed-tracing/dt.tap.js @@ -36,7 +36,7 @@ tap.test('distributed tracing full integration', (t) => { agent.config.account_id = ACCOUNT_ID agent.config.trusted_account_key = ACCOUNT_ID - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -90,7 +90,7 @@ tap.test('distributed tracing full integration', (t) => { res.end() }) - t.tearDown(() => { + t.teardown(() => { start.close() middle.close() end.close() diff --git a/test/integration/distributed-tracing/span-error-attributes.tap.js b/test/integration/distributed-tracing/span-error-attributes.tap.js index e1fee838b9..d1d63b8a7e 100644 --- a/test/integration/distributed-tracing/span-error-attributes.tap.js +++ b/test/integration/distributed-tracing/span-error-attributes.tap.js @@ -75,7 +75,7 @@ tap.test('span error attributes', (t) => { } }) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -258,7 +258,7 @@ tap.test('span error attributes', (t) => { } }) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) diff --git a/test/integration/distributed-tracing/transaction-span-attributes.tap.js b/test/integration/distributed-tracing/transaction-span-attributes.tap.js index 2d476c8586..6d7bb83302 100644 --- a/test/integration/distributed-tracing/transaction-span-attributes.tap.js +++ b/test/integration/distributed-tracing/transaction-span-attributes.tap.js @@ -16,7 +16,7 @@ tap.test('should apply transaction name as active span intrinsic on transaction } }) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) diff --git a/test/integration/fastify/errors.tap.js b/test/integration/fastify/errors.tap.js index 750021c705..8f36989e15 100644 --- a/test/integration/fastify/errors.tap.js +++ b/test/integration/fastify/errors.tap.js @@ -34,7 +34,7 @@ tap.test('Test Errors', (test)=>{ ) }) - test.tearDown(() => { + test.teardown(() => { helper.unloadAgent(agent) fastify.close() }) diff --git a/test/integration/grpc/reconnect.tap.js b/test/integration/grpc/reconnect.tap.js index 501acee10d..ef1b3ac82a 100644 --- a/test/integration/grpc/reconnect.tap.js +++ b/test/integration/grpc/reconnect.tap.js @@ -230,7 +230,7 @@ function setupServer(t, sslOpts, recordSpan) { server.start() resolve(port) // shutdown server when tests finish - t.tearDown(()=>{ + t.teardown(()=>{ server.tryShutdown(()=>{ }) }) diff --git a/test/integration/instrumentation/http-outbound.tap.js b/test/integration/instrumentation/http-outbound.tap.js index 5911d5ea39..a5a486f4e2 100644 --- a/test/integration/instrumentation/http-outbound.tap.js +++ b/test/integration/instrumentation/http-outbound.tap.js @@ -63,7 +63,7 @@ tap.test('external requests', function(t) { req.resume() res.end('ok') }) - t.tearDown(function() { + t.teardown(function() { server.close() }) @@ -151,7 +151,7 @@ tap.test('external requests', function(t) { var got = require('got') helper.runInTransaction(agent, function() { var req = got('https://example.com/') - t.tearDown(function() { req.cancel() }) + t.teardown(function() { req.cancel() }) req.then( function() { t.end() }, function(e) { t.error(e); t.end() } diff --git a/test/integration/instrumentation/http-rum.tap.js b/test/integration/instrumentation/http-rum.tap.js index 9e63c07480..f75c5a08ca 100644 --- a/test/integration/instrumentation/http-rum.tap.js +++ b/test/integration/instrumentation/http-rum.tap.js @@ -76,7 +76,7 @@ test('custom naming rules should be applied early for RUM', function(t) { } }) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { external.close() helper.unloadAgent(agent) }) @@ -124,7 +124,7 @@ test('custom web transactions should have rules applied for RUM', function(t) { t.end() }) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { helper.unloadAgent(agent) }) }) diff --git a/test/integration/instrumentation/http.tap.js b/test/integration/instrumentation/http.tap.js index 9e003b1f72..e4cb7861ec 100644 --- a/test/integration/instrumentation/http.tap.js +++ b/test/integration/instrumentation/http.tap.js @@ -87,7 +87,7 @@ test( req.end() }) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { external.close() server.close() helper.unloadAgent(agent) @@ -201,7 +201,7 @@ test('built-in http instrumentation should not swallow errors', function(t) { let server = null - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close() helper.unloadAgent(agent) }) @@ -279,7 +279,7 @@ test("built-in http instrumentation making outbound requests", function(t) { res.end(body) }) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close() helper.unloadAgent(agent) }) @@ -350,7 +350,7 @@ test("built-in http instrumentation should not crash for requests that are in pr var agent = helper.instrumentMockedAgent() - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { helper.unloadAgent(agent) }) @@ -411,7 +411,7 @@ test( var agent = helper.instrumentMockedAgent() - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { helper.unloadAgent(agent) server.close() }) diff --git a/test/integration/instrumentation/oracle.tap.js b/test/integration/instrumentation/oracle.tap.js index e78fa51f56..e400ef24cc 100644 --- a/test/integration/instrumentation/oracle.tap.js +++ b/test/integration/instrumentation/oracle.tap.js @@ -55,7 +55,7 @@ function runTest(t) { oracleSetup(preparedTest) ) - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) } diff --git a/test/integration/instrumentation/promises/methods.js b/test/integration/instrumentation/promises/methods.js index 6fdabe2286..4f37818bc4 100644 --- a/test/integration/instrumentation/promises/methods.js +++ b/test/integration/instrumentation/promises/methods.js @@ -1927,7 +1927,7 @@ function _testPromiseContext(t, agent, factory) { }) helper.runInTransaction(agent, function(txB) { - t.tearDown(function() { + t.teardown(function() { ctxA.transaction.end() txB.end() }) @@ -1946,7 +1946,7 @@ function _testPromiseContext(t, agent, factory) { t.plan(2) var ctxA = helper.runInTransaction(agent, function(tx) { - t.tearDown(function() { + t.teardown(function() { tx.end() }) @@ -1991,7 +1991,7 @@ function _testPromiseContext(t, agent, factory) { ctxA.transaction.end() helper.runInTransaction(agent, function(txB) { - t.tearDown(function() { + t.teardown(function() { ctxA.transaction.end() txB.end() }) diff --git a/test/integration/instrumentation/promises/regressions.js b/test/integration/instrumentation/promises/regressions.js index 115ee20a2c..759a91a1cd 100644 --- a/test/integration/instrumentation/promises/regressions.js +++ b/test/integration/instrumentation/promises/regressions.js @@ -14,7 +14,7 @@ module.exports = function(t, loadLibrary) { // promise instrumentation. var agent = helper.loadMockedAgent() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) var Promise = loadLibrary() diff --git a/test/integration/instrumentation/q.tap.js b/test/integration/instrumentation/q.tap.js index fe1061b772..c845a71118 100644 --- a/test/integration/instrumentation/q.tap.js +++ b/test/integration/instrumentation/q.tap.js @@ -128,7 +128,7 @@ test('q.then rejections', function testQNInvoke(t) { function setupAgent(t) { var agent = helper.instrumentMockedAgent() - t.tearDown(function tearDown() { + t.teardown(function tearDown() { helper.unloadAgent(agent) }) diff --git a/test/integration/instrumentation/restify.tap.js b/test/integration/instrumentation/restify.tap.js index a0e3b02f76..33d623b451 100644 --- a/test/integration/instrumentation/restify.tap.js +++ b/test/integration/instrumentation/restify.tap.js @@ -26,7 +26,7 @@ tap.test('should not crash when Restify handles a connection', function(t) { const restify = require('restify') const server = restify.createServer() - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { helper.unloadAgent(agent) server.close() }) @@ -89,7 +89,7 @@ tap.test('Restify should still be instrumented when run with SSL', function(t) { const restify = require('restify') const server = restify.createServer({key, certificate}) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { helper.unloadAgent(agent) server.close() }) @@ -141,7 +141,7 @@ tap.test('Restify should generate middleware metrics', function(t) { const restify = require('restify') const server = restify.createServer() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) server.close() }) diff --git a/test/integration/instrumentation/when.tap.js b/test/integration/instrumentation/when.tap.js index 8a49284de6..80ec94405d 100644 --- a/test/integration/instrumentation/when.tap.js +++ b/test/integration/instrumentation/when.tap.js @@ -183,7 +183,7 @@ test('when debug API', function(t) { return originalEmit.call(process, event, ...args) } - t.tearDown(() => { + t.teardown(() => { process.emit = asyncHookDomainEmit }) @@ -873,7 +873,7 @@ function setupAgent(t, enableSegments) { var agent = helper.instrumentMockedAgent({ feature_flag: {promise_segments: enableSegments} }) - t.tearDown(function tearDown() { + t.teardown(function tearDown() { helper.unloadAgent(agent) }) return agent diff --git a/test/integration/keep-alive.tap.js b/test/integration/keep-alive.tap.js index 595308111d..286498ecdf 100644 --- a/test/integration/keep-alive.tap.js +++ b/test/integration/keep-alive.tap.js @@ -36,7 +36,7 @@ tap.test("RemoteMethod makes two requests with one connection", (t) => { }) // close server when test ends - t.tearDown(() => { + t.teardown(() => { server.close() }) diff --git a/test/integration/module-loading/module-loading.tap.js b/test/integration/module-loading/module-loading.tap.js index 8a47e3154c..40c6ca869f 100644 --- a/test/integration/module-loading/module-loading.tap.js +++ b/test/integration/module-loading/module-loading.tap.js @@ -18,7 +18,7 @@ tap.test('Should properly track module paths to enable shim.require()', function let agent = helper.instrumentMockedAgent() - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) agent = null }) @@ -52,7 +52,7 @@ tap.test('shim.require() should play well with multiple test runs', (t) => { moduleName: customPackagePath }) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) agent = null }) diff --git a/test/integration/pricing/docker-info.tap.js b/test/integration/pricing/docker-info.tap.js index 8be6c03394..59f5399b6c 100644 --- a/test/integration/pricing/docker-info.tap.js +++ b/test/integration/pricing/docker-info.tap.js @@ -20,7 +20,7 @@ test('pricing docker info', function(t) { var os = require('os') var originalPlatform = os.platform os.platform = function() { return 'linux' } - t.tearDown(function() { + t.teardown(function() { os.platform = originalPlatform }) @@ -44,7 +44,7 @@ test('pricing docker info', function(t) { function makeTest(testCase) { return function(t) { var agent = helper.loadMockedAgent() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) dockerInfo.clearVendorCache() }) @@ -73,7 +73,7 @@ function makeTest(testCase) { function mockProcRead(t, testFile) { var original = common.readProc - t.tearDown(function() { + t.teardown(function() { common.readProc = original }) diff --git a/test/integration/pricing/pcf-info.tap.js b/test/integration/pricing/pcf-info.tap.js index efdb0d4984..d04a37c732 100644 --- a/test/integration/pricing/pcf-info.tap.js +++ b/test/integration/pricing/pcf-info.tap.js @@ -37,7 +37,7 @@ tap.test('pricing pcf info', function(t) { function makeTest(testCase, getInfo) { return function(t) { var agent = helper.loadMockedAgent() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) diff --git a/test/integration/pricing/system-info.tap.js b/test/integration/pricing/system-info.tap.js index 7e0923d7c8..195413eed1 100644 --- a/test/integration/pricing/system-info.tap.js +++ b/test/integration/pricing/system-info.tap.js @@ -37,7 +37,7 @@ test('pricing system-info aws', function(t) { detect_docker: false } }) - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) @@ -83,7 +83,7 @@ test('pricing system-info azure', function(t) { detect_docker: false } }) - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) @@ -112,7 +112,7 @@ test('pricing system-info azure', function(t) { test('pricing system-info gcp', function(t) { nock.disableNetConnect() - t.tearDown(function() { + t.teardown(function() { nock.enableNetConnect() }) @@ -137,7 +137,7 @@ test('pricing system-info gcp', function(t) { detect_docker: false } }) - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) @@ -169,7 +169,7 @@ test('pricing system-info pcf', function(t) { detect_docker: false } }) - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) @@ -211,7 +211,7 @@ test('pricing system-info docker', function(t) { detect_docker: true } }) - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) diff --git a/test/integration/pricing/vendor-info-tests.js b/test/integration/pricing/vendor-info-tests.js index 8b215d3c2f..bcaef275d4 100644 --- a/test/integration/pricing/vendor-info-tests.js +++ b/test/integration/pricing/vendor-info-tests.js @@ -22,7 +22,7 @@ module.exports = function(t, vendor) { var getInfo = require('../../../lib/utilization/' + vendor + '-info') nock.disableNetConnect() - t.tearDown(function() { + t.teardown(function() { nock.enableNetConnect() }) @@ -48,7 +48,7 @@ function makeTest(testCase, vendor, getInfo) { var agent = null return function(t) { agent = helper.loadMockedAgent() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) getInfo.clearCache() nock.cleanAll() diff --git a/test/integration/transaction/total-time.tap.js b/test/integration/transaction/total-time.tap.js index ae9e28a9fa..7eb55b7c07 100644 --- a/test/integration/transaction/total-time.tap.js +++ b/test/integration/transaction/total-time.tap.js @@ -185,7 +185,7 @@ test( function getAgent(t) { var agent = helper.loadMockedAgent() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) diff --git a/test/integration/transaction/trace-async-propagation.tap.js b/test/integration/transaction/trace-async-propagation.tap.js index 8d5ea7ae51..ec545fd194 100644 --- a/test/integration/transaction/trace-async-propagation.tap.js +++ b/test/integration/transaction/trace-async-propagation.tap.js @@ -19,7 +19,7 @@ test("asynchronous state propagation", function(t) { var agent = helper.instrumentMockedAgent() - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { // FIXME: why does CLS keep the transaction? if (agent.getTransaction()) agent.getTransaction().end() helper.unloadAgent(agent) @@ -40,7 +40,7 @@ test("asynchronous state propagation", function(t) { const agent = helper.instrumentMockedAgent() let handle - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { // FIXME: why does CLS keep the transaction? if (agent.getTransaction()) agent.getTransaction().end() helper.unloadAgent(agent) @@ -61,7 +61,7 @@ test("asynchronous state propagation", function(t) { var agent = helper.instrumentMockedAgent() - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { // FIXME: why does CLS keep the transaction? if (agent.getTransaction()) agent.getTransaction().end() helper.unloadAgent(agent) @@ -84,7 +84,7 @@ test("asynchronous state propagation", function(t) { var agent = helper.instrumentMockedAgent() const ee = new EventEmitter() - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { // FIXME: why does CLS keep the transaction? if (agent.getTransaction()) agent.getTransaction().end() helper.unloadAgent(agent) @@ -113,7 +113,7 @@ test("asynchronous state propagation", function(t) { var agent = helper.instrumentMockedAgent() - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { // FIXME: why does CLS keep the transaction? if (agent.getTransaction()) agent.getTransaction().end() helper.unloadAgent(agent) @@ -147,7 +147,7 @@ test("asynchronous state propagation", function(t) { var agent = helper.instrumentMockedAgent() - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { // FIXME: why does CLS keep the transaction? if (agent.getTransaction()) agent.getTransaction().end() helper.unloadAgent(agent) @@ -189,7 +189,7 @@ test("asynchronous state propagation", function(t) { let second const agent = helper.instrumentMockedAgent() - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { // FIXME: why does CLS keep the transaction? if (agent.getTransaction()) agent.getTransaction().end() helper.unloadAgent(agent) @@ -226,7 +226,7 @@ test("asynchronous state propagation", function(t) { let ee = new EventEmitter() - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { // FIXME: why does CLS keep the transaction? if (agent.getTransaction()) agent.getTransaction().end() helper.unloadAgent(agent) @@ -254,7 +254,7 @@ test("asynchronous state propagation", function(t) { var agent = helper.instrumentMockedAgent() - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { // FIXME: why does CLS keep the transaction? if (agent.getTransaction()) agent.getTransaction().end() helper.unloadAgent(agent) @@ -292,7 +292,7 @@ test("asynchronous state propagation", function(t) { let innerHandle - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { // FIXME: why does CLS keep the transaction? if (agent.getTransaction()) agent.getTransaction().end() helper.unloadAgent(agent) @@ -329,7 +329,7 @@ test("asynchronous state propagation", function(t) { var agent = helper.instrumentMockedAgent() - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { // FIXME: why does CLS keep the transaction? if (agent.getTransaction()) agent.getTransaction().end() helper.unloadAgent(agent) @@ -371,7 +371,7 @@ test("asynchronous state propagation", function(t) { const outer = new EventEmitter() const inner = new EventEmitter() - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { // FIXME: why does CLS keep the transaction? if (agent.getTransaction()) agent.getTransaction().end() helper.unloadAgent(agent) diff --git a/test/integration/uninstrumented/uninstrumented.tap.js b/test/integration/uninstrumented/uninstrumented.tap.js index a34bfbf6b3..09c0df3e5a 100644 --- a/test/integration/uninstrumented/uninstrumented.tap.js +++ b/test/integration/uninstrumented/uninstrumented.tap.js @@ -23,7 +23,7 @@ tap.test('does not mark files with known module names as uninstrumented', functi const agent = helper.instrumentMockedAgent() - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -68,7 +68,7 @@ tap.test('all instrumented modules should be detected when uninstrumented', func const agent = helper.instrumentMockedAgent() - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) diff --git a/test/lib/agent_helper.js b/test/lib/agent_helper.js index 8834024ef3..e2930a171d 100644 --- a/test/lib/agent_helper.js +++ b/test/lib/agent_helper.js @@ -168,7 +168,7 @@ const helper = module.exports = { loadTestAgent: (t, conf, setState = true) => { let agent = helper.instrumentMockedAgent(conf, setState) - t.tearDown(() => { + t.teardown(() => { helper.unloadAgent(agent) }) @@ -361,7 +361,7 @@ const helper = module.exports = { t.comment('Removing listeners for %s', evnt) let listeners = emitter.listeners(evnt) - t.tearDown(() => { + t.teardown(() => { t.comment('Re-adding listeners for %s', evnt) listeners.forEach((fn) => { emitter.on(evnt, fn) diff --git a/test/versioned/amqplib/callback.tap.js b/test/versioned/amqplib/callback.tap.js index 84b7c91126..5ca263a47b 100644 --- a/test/versioned/amqplib/callback.tap.js +++ b/test/versioned/amqplib/callback.tap.js @@ -32,7 +32,7 @@ tap.test('amqplib callback instrumentation', function(t) { var agent = null var api = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent({ attributes: { enabled: true @@ -53,25 +53,27 @@ tap.test('amqplib callback instrumentation', function(t) { api.instrumentMessages('amqplib/callback_api', instrumentation.instrumentCallbackAPI) amqplib = require('amqplib/callback_api') - amqpUtils.getChannel(amqplib, function(err, result) { - if (err) { - return done(err) - } - - conn = result.connection - channel = result.channel - channel.assertQueue('testQueue', null, done) + return new Promise((resolve, reject) => { + amqpUtils.getChannel(amqplib, function(err, result) { + if (err) { + reject(err) + } + + conn = result.connection + channel = result.channel + channel.assertQueue('testQueue', null, resolve) + }) }) }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) if (!conn) { - return done() + return } - conn.close(done) + return conn.close() }) t.test('connect in a transaction', function(t) { diff --git a/test/versioned/amqplib/promises.tap.js b/test/versioned/amqplib/promises.tap.js index 8fd43bbeb2..b72ce2d720 100644 --- a/test/versioned/amqplib/promises.tap.js +++ b/test/versioned/amqplib/promises.tap.js @@ -32,7 +32,7 @@ tap.test('amqplib promise instrumentation', function(t) { var agent = null var api = null - t.beforeEach(function(done) { + t.beforeEach(function() { // In promise mode, amqplib loads bluebird. In our tests we unwrap the // instrumentation after each one. This is fine for first-order modules // which the test itself re-requires, but second-order modules (deps of @@ -64,23 +64,22 @@ tap.test('amqplib promise instrumentation', function(t) { api.instrumentMessages('amqplib', instrumentation.instrumentPromiseAPI) amqplib = require('amqplib') - amqpUtils.getChannel(amqplib) + return amqpUtils.getChannel(amqplib) .then(function(result) { conn = result.connection channel = result.channel return channel.assertQueue('testQueue') }) - .then(function() { done() }, done) }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) if (!conn) { - return done() + return } - conn.close().then(done, done) + return conn.close() }) t.test('connect in a transaction', function(t) { diff --git a/test/versioned/bluebird/transaction-state.tap.js b/test/versioned/bluebird/transaction-state.tap.js index 5d06847b43..9dd50b02de 100644 --- a/test/versioned/bluebird/transaction-state.tap.js +++ b/test/versioned/bluebird/transaction-state.tap.js @@ -27,7 +27,7 @@ function setupAgent(t, enableSegments) { var agent = helper.instrumentMockedAgent({ feature_flag: {promise_segments: enableSegments} }) - t.tearDown(function tearDown() { + t.teardown(function tearDown() { helper.unloadAgent(agent) }) return agent diff --git a/test/versioned/cassandra-driver/query.tap.js b/test/versioned/cassandra-driver/query.tap.js index c0411c7ebb..c52d143def 100644 --- a/test/versioned/cassandra-driver/query.tap.js +++ b/test/versioned/cassandra-driver/query.tap.js @@ -191,7 +191,7 @@ test('Cassandra instrumentation', {timeout: 5000}, function testInstrumentation( } }) - t.tearDown(function tearDown() { + t.teardown(function tearDown() { helper.unloadAgent(agent) client.shutdown() }) diff --git a/test/versioned/cls/cls.tap.js b/test/versioned/cls/cls.tap.js index 86aa6ae24e..08d1695e85 100644 --- a/test/versioned/cls/cls.tap.js +++ b/test/versioned/cls/cls.tap.js @@ -27,7 +27,7 @@ function setupAgent(t, enableSegments) { var agent = helper.instrumentMockedAgent({ feature_flag: {promise_segments: enableSegments} }) - t.tearDown(function tearDown() { + t.teardown(function tearDown() { helper.unloadAgent(agent) }) return agent diff --git a/test/versioned/connect/error-intercept.tap.js b/test/versioned/connect/error-intercept.tap.js index 793bae818c..262fb39504 100644 --- a/test/versioned/connect/error-intercept.tap.js +++ b/test/versioned/connect/error-intercept.tap.js @@ -22,7 +22,7 @@ test("intercepting errors with connect 2", function(t) { var app = connect() - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { helper.unloadAgent(agent) }) @@ -49,7 +49,7 @@ test("intercepting errors with connect 2", function(t) { var app = connect() - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { helper.unloadAgent(agent) }) @@ -83,7 +83,7 @@ test("intercepting errors with connect 2", function(t) { t.end() }) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { helper.unloadAgent(agent) }) diff --git a/test/versioned/director/director.tap.js b/test/versioned/director/director.tap.js index 15f0813107..59e06eba7d 100644 --- a/test/versioned/director/director.tap.js +++ b/test/versioned/director/director.tap.js @@ -35,7 +35,7 @@ tap.test("basic director test", function(t) { var router = new director.http.Router(routes).configure({ recurse: 'forward' }) - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) server.close(function() {}) }) @@ -123,7 +123,7 @@ tap.test("backward recurse director test", function(t) { var router = new director.http.Router(routes).configure({ recurse: 'backward' }) - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) server.close(function() {}) }) @@ -173,7 +173,7 @@ tap.test("two routers with same URI director test", function(t) { var router = new director.http.Router() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) server.close(function() {}) }) @@ -230,7 +230,7 @@ tap.test("director async routes test", function(t) { var router = new director.http.Router().configure({ async: true }) - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) server.close(function() {}) }) @@ -318,7 +318,7 @@ tap.test("express w/ director subrouter test", function(t) { } var router = new director.http.Router(routes) - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) server.close(function() {}) }) diff --git a/test/versioned/express/app-use.tap.js b/test/versioned/express/app-use.tap.js index 8ae4bc6546..3b9ce2e9f8 100644 --- a/test/versioned/express/app-use.tap.js +++ b/test/versioned/express/app-use.tap.js @@ -14,7 +14,7 @@ test('app should be at top of stack when mounted', function(t) { var agent = helper.instrumentMockedAgent() var express = require('express') - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { helper.unloadAgent(agent) }) @@ -45,7 +45,7 @@ test('app should be at top of stack when mounted', function(t) { var router2 = new express.Router() var server = http.createServer(main) - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) server.close() }) @@ -138,7 +138,7 @@ test('should not pass wrong args when transaction is not present', function(t) { main.use('/', router) main.use('/', router2) - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) server.close() }) diff --git a/test/versioned/express/bare-router.tap.js b/test/versioned/express/bare-router.tap.js index 5e0cbac465..8db36b4800 100644 --- a/test/versioned/express/bare-router.tap.js +++ b/test/versioned/express/bare-router.tap.js @@ -18,7 +18,7 @@ test("Express router introspection", function(t) { var app = express() var server = require('http').createServer(app) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close(function cb_close() { helper.unloadAgent(agent) }) diff --git a/test/versioned/express/captures-params.tap.js b/test/versioned/express/captures-params.tap.js index f3661c0ffc..5ca093a9b4 100644 --- a/test/versioned/express/captures-params.tap.js +++ b/test/versioned/express/captures-params.tap.js @@ -23,7 +23,7 @@ tap.test('test attributes.enabled for express', function(t) { t.autoend() var agent = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent({ apdex_t: 1, allow_all_headers: false, @@ -32,14 +32,10 @@ tap.test('test attributes.enabled for express', function(t) { include: ['request.parameters.*'] } }) - - - done() }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) - done() }) t.test('no variables', function(t) { @@ -47,7 +43,7 @@ tap.test('test attributes.enabled for express', function(t) { var server = require('http').createServer(app) var port = null - t.tearDown(function() { + t.teardown(function() { server.close() }) @@ -97,7 +93,7 @@ tap.test('test attributes.enabled for express', function(t) { var server = require('http').createServer(app) var port = null - t.tearDown(function() { + t.teardown(function() { server.close() }) @@ -141,7 +137,7 @@ tap.test('test attributes.enabled for express', function(t) { var server = require('http').createServer(app) var port = null - t.tearDown(function() { + t.teardown(function() { server.close() }) @@ -185,7 +181,7 @@ tap.test('test attributes.enabled for express', function(t) { var server = require('http').createServer(app) var port = null - t.tearDown(function() { + t.teardown(function() { server.close() }) @@ -233,7 +229,7 @@ tap.test('test attributes.enabled for express', function(t) { var server = require('http').createServer(app) var port = null - t.tearDown(function() { + t.teardown(function() { server.close() }) diff --git a/test/versioned/express/errors.tap.js b/test/versioned/express/errors.tap.js index 5b0189f75a..d13881815e 100644 --- a/test/versioned/express/errors.tap.js +++ b/test/versioned/express/errors.tap.js @@ -231,7 +231,7 @@ function runTests(flags) { }) }) - t.tearDown(function() { + t.teardown(function() { server.close() }) }) @@ -241,7 +241,7 @@ function runTests(flags) { express = require('express') app = express() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) } @@ -267,7 +267,7 @@ function runTests(flags) { response.resume() }) }) - t.tearDown(function() { + t.teardown(function() { server.close() }) } diff --git a/test/versioned/express/express-enrouten.tap.js b/test/versioned/express/express-enrouten.tap.js index 581d317ea0..e89487b2b1 100644 --- a/test/versioned/express/express-enrouten.tap.js +++ b/test/versioned/express/express-enrouten.tap.js @@ -23,7 +23,7 @@ test("Express + express-enrouten compatibility test", function(t) { app.use(enrouten({directory: './fixtures'})) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close(function cb_close() { helper.unloadAgent(agent) }) diff --git a/test/versioned/express/ignoring.tap.js b/test/versioned/express/ignoring.tap.js index 7e2a2cf95a..5300aa6c15 100644 --- a/test/versioned/express/ignoring.tap.js +++ b/test/versioned/express/ignoring.tap.js @@ -22,7 +22,7 @@ test("ignoring an Express route", function(t) { var server = require('http').createServer(app) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close(function cb_close() { helper.unloadAgent(agent) }) diff --git a/test/versioned/express/middleware-name.tap.js b/test/versioned/express/middleware-name.tap.js index 2210616f77..937e9f826e 100644 --- a/test/versioned/express/middleware-name.tap.js +++ b/test/versioned/express/middleware-name.tap.js @@ -15,7 +15,7 @@ test('should name middleware correctly', function(t) { var app = require('express')() var server - t.tearDown(function() { + t.teardown(function() { server.close() helper.unloadAgent(agent) }) diff --git a/test/versioned/express/render.tap.js b/test/versioned/express/render.tap.js index 5e5c0b6cf0..017d00466a 100644 --- a/test/versioned/express/render.tap.js +++ b/test/versioned/express/render.tap.js @@ -45,7 +45,7 @@ function runTests(conf) { var agent = helper.instrumentMockedAgent(conf) var router = require('express').Router() // eslint-disable-line new-cap - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { helper.unloadAgent(agent) }) @@ -68,7 +68,7 @@ function runTests(conf) { t.plan(2) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { helper.unloadAgent(agent) }) @@ -96,23 +96,20 @@ function runTests(conf) { var app = null var server = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent(conf) app = require('express')() server = require('http').createServer(app) - done() }) - t.afterEach(function(done) { + t.afterEach(function() { server.close() helper.unloadAgent(agent) agent = null app = null server = null - - done() }) t.test("for a normal request", {timeout : 1000}, function(t) { @@ -333,7 +330,7 @@ function runTests(conf) { var app = require('express')() var server = require('http').createServer(app) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close() helper.unloadAgent(agent) }) @@ -364,7 +361,7 @@ function runTests(conf) { var app = require('express')() var server = require('http').createServer(app) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close() helper.unloadAgent(agent) }) @@ -399,7 +396,7 @@ function runTests(conf) { var app = require('express')() var server = require('http').createServer(app) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close() helper.unloadAgent(agent) }) @@ -434,7 +431,7 @@ function runTests(conf) { var app = require('express')() var server = require('http').createServer(app) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close() helper.unloadAgent(agent) }) @@ -464,7 +461,7 @@ function runTests(conf) { var app = require('express')() var server = require('http').createServer(app) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close() helper.unloadAgent(agent) }) @@ -503,7 +500,7 @@ function runTests(conf) { var app = require('express')() var server = require('http').createServer(app) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close() helper.unloadAgent(agent) }) @@ -540,7 +537,7 @@ function runTests(conf) { var app = require('express')() var server = require('http').createServer(app) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close() helper.unloadAgent(agent) }) @@ -579,7 +576,7 @@ function runTests(conf) { var agent = helper.instrumentMockedAgent(conf) var app = require('express')() var server = require('http').createServer(app) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close() helper.unloadAgent(agent) }) diff --git a/test/versioned/express/route-iteration.tap.js b/test/versioned/express/route-iteration.tap.js index d638f0fb07..ae3b5030d5 100644 --- a/test/versioned/express/route-iteration.tap.js +++ b/test/versioned/express/route-iteration.tap.js @@ -18,7 +18,7 @@ test("new relic should not break route iteration", function(t) { var childB = new express.Router() - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { helper.unloadAgent(agent) }) diff --git a/test/versioned/express/route-param.tap.js b/test/versioned/express/route-param.tap.js index d22d37e5d9..9f0697019f 100644 --- a/test/versioned/express/route-param.tap.js +++ b/test/versioned/express/route-param.tap.js @@ -15,7 +15,7 @@ test('Express route param', function(t) { const express = require('express') const server = createServer(express) - t.tearDown(function() { + t.teardown(function() { server.close(function() { helper.unloadAgent(agent) }) diff --git a/test/versioned/express/router-params.tap.js b/test/versioned/express/router-params.tap.js index 1682aaa793..66e28c5b55 100644 --- a/test/versioned/express/router-params.tap.js +++ b/test/versioned/express/router-params.tap.js @@ -32,7 +32,7 @@ test("Express router introspection", function(t) { }) app.use('/a/:param1', router) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close(function cb_close() { helper.unloadAgent(agent) }) diff --git a/test/versioned/express/segments.tap.js b/test/versioned/express/segments.tap.js index 16212fbbe3..eb14b0ee98 100644 --- a/test/versioned/express/segments.tap.js +++ b/test/versioned/express/segments.tap.js @@ -736,7 +736,7 @@ function setup(t) { express = require('express') app = express() - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { helper.unloadAgent(agent) }) } @@ -775,7 +775,7 @@ function runTest(t, options, callback) { }) }) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close() }) } diff --git a/test/versioned/express/transaction-naming.tap.js b/test/versioned/express/transaction-naming.tap.js index aaf88f15f5..1f06f14778 100644 --- a/test/versioned/express/transaction-naming.tap.js +++ b/test/versioned/express/transaction-naming.tap.js @@ -53,7 +53,7 @@ function runTests(flags) { var server = app.listen(function() { makeRequest(server, endpoint) }) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close() }) }) @@ -370,7 +370,7 @@ function runTests(flags) { numTests ) var server = app.listen(function() { - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close() }) for (var i = 0; i < numTests; i++) { @@ -427,7 +427,7 @@ function runTests(flags) { t.equal(tx.name, 'WebTransaction/Expressjs/GET//test') }) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close() }) }) @@ -453,7 +453,7 @@ function runTests(flags) { http.request({ port: server.address().port, path: '/test' }).end() }) - t.tearDown(function() { + t.teardown(function() { server.close() }) }) @@ -520,7 +520,7 @@ function runTests(flags) { }) }, 100) }) - t.tearDown(function() { + t.teardown(function() { server.close() clearInterval(interval) }) @@ -531,7 +531,7 @@ function runTests(flags) { express = require('express') app = express() - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { helper.unloadAgent(agent) }) } @@ -566,7 +566,7 @@ function runTests(flags) { var server = app.listen(function() { makeRequest(server, endpoint) }) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close() }) } diff --git a/test/versioned/generic-pool/basic-v2.tap.js b/test/versioned/generic-pool/basic-v2.tap.js index 27d5b05b43..01c4af0784 100644 --- a/test/versioned/generic-pool/basic-v2.tap.js +++ b/test/versioned/generic-pool/basic-v2.tap.js @@ -17,16 +17,14 @@ tap.test('generic-pool', function(t) { var pool = null var PoolClass = require('generic-pool').Pool - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() pool = require('generic-pool') - done() }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) pool = null - done() }) var tasks = [] @@ -36,7 +34,7 @@ tap.test('generic-pool', function(t) { } }, 10) - t.tearDown(function() { + t.teardown(function() { clearInterval(decontextInterval) }) diff --git a/test/versioned/generic-pool/basic.tap.js b/test/versioned/generic-pool/basic.tap.js index 13d8c0b98c..0be1592a21 100644 --- a/test/versioned/generic-pool/basic.tap.js +++ b/test/versioned/generic-pool/basic.tap.js @@ -17,16 +17,14 @@ tap.test('generic-pool', function(t) { var pool = null var PoolClass = require('generic-pool').Pool - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() pool = require('generic-pool') - done() }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) pool = null - done() }) var tasks = [] @@ -36,7 +34,7 @@ tap.test('generic-pool', function(t) { } }, 10) - t.tearDown(function() { + t.teardown(function() { clearInterval(decontextInterval) }) diff --git a/test/versioned/hapi/hapi-17/capture-params.tap.js b/test/versioned/hapi/hapi-17/capture-params.tap.js index 7a1cdcc0ab..57f5e54a25 100644 --- a/test/versioned/hapi/hapi-17/capture-params.tap.js +++ b/test/versioned/hapi/hapi-17/capture-params.tap.js @@ -19,7 +19,7 @@ tap.test('Hapi capture params support', function(t) { var server = null var port = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent({ attributes: { enabled: true, @@ -30,7 +30,6 @@ tap.test('Hapi capture params support', function(t) { server = utils.getServer() agent.config.attributes.enabled = true - done() }) t.afterEach(function() { diff --git a/test/versioned/hapi/hapi-17/errors.tap.js b/test/versioned/hapi/hapi-17/errors.tap.js index 8b0e87ab04..1a09508fcd 100644 --- a/test/versioned/hapi/hapi-17/errors.tap.js +++ b/test/versioned/hapi/hapi-17/errors.tap.js @@ -17,11 +17,10 @@ var port tap.test('Hapi v17 error handling', function(t) { t.autoend() - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() server = utils.getServer() - done() }) t.afterEach(function() { @@ -218,7 +217,7 @@ function runTest(t, callback) { response.resume() }) }) - t.tearDown(function() { + t.teardown(function() { server.stop() }) } diff --git a/test/versioned/hapi/hapi-17/ext.tap.js b/test/versioned/hapi/hapi-17/ext.tap.js index bb847973ec..0f19e20dce 100644 --- a/test/versioned/hapi/hapi-17/ext.tap.js +++ b/test/versioned/hapi/hapi-17/ext.tap.js @@ -33,15 +33,14 @@ tap.test('Hapi v17 ext', function(t) { }) } - t.tearDown(function() { + t.teardown(function() { clearInterval(intervalId) }) - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() server = utils.getServer() - done() }) t.afterEach(function() { diff --git a/test/versioned/hapi/hapi-17/ignoring.tap.js b/test/versioned/hapi/hapi-17/ignoring.tap.js index 0b0810b318..3c82b177f8 100644 --- a/test/versioned/hapi/hapi-17/ignoring.tap.js +++ b/test/versioned/hapi/hapi-17/ignoring.tap.js @@ -18,7 +18,7 @@ test('ignoring a Hapi route', function(t) { const api = new API(agent) const server = utils.getServer() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) return server.stop() }) diff --git a/test/versioned/hapi/hapi-17/plugins.tap.js b/test/versioned/hapi/hapi-17/plugins.tap.js index c4cf580378..cbb174b0a9 100644 --- a/test/versioned/hapi/hapi-17/plugins.tap.js +++ b/test/versioned/hapi/hapi-17/plugins.tap.js @@ -26,15 +26,14 @@ tap.test('Hapi Plugins', function(t) { } }, 10) - t.tearDown(function() { + t.teardown(function() { clearInterval(intervalId) }) - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() server = utils.getServer() - done() }) t.afterEach(function() { diff --git a/test/versioned/hapi/hapi-17/render.tap.js b/test/versioned/hapi/hapi-17/render.tap.js index 2a0ba416ca..bb3beb6421 100644 --- a/test/versioned/hapi/hapi-17/render.tap.js +++ b/test/versioned/hapi/hapi-17/render.tap.js @@ -21,11 +21,10 @@ tap.test('agent instrumentation of Hapi', function(t) { var server = null var port = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() server = utils.getServer() - done() }) t.afterEach(function() { @@ -54,7 +53,7 @@ tap.test('agent instrumentation of Hapi', function(t) { /application\/json/.test(response.headers['content-type']), 'got correct content type' ) - t.deepEqual(JSON.parse(body), { yep: true }, 'response survived') + t.same(JSON.parse(body), { yep: true }, 'response survived') var stats @@ -214,7 +213,7 @@ tap.test('agent instrumentation of Hapi', function(t) { var first = errors[0] t.ok(first, 'have the first error') - t.contains(first[2], 'ohno', 'got the expected error') + t.match(first[2], 'ohno', 'got the expected error') t.end() }) diff --git a/test/versioned/hapi/hapi-17/router.tap.js b/test/versioned/hapi/hapi-17/router.tap.js index 79932a06a5..5a0160fe5c 100644 --- a/test/versioned/hapi/hapi-17/router.tap.js +++ b/test/versioned/hapi/hapi-17/router.tap.js @@ -17,7 +17,7 @@ tap.test('Hapi router introspection', function(t) { var server = null var port = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent({ attributes: { enabled: true, @@ -26,8 +26,6 @@ tap.test('Hapi router introspection', function(t) { }) server = utils.getServer() - - done() }) t.afterEach(function() { diff --git a/test/versioned/hapi/hapi-17/segments.tap.js b/test/versioned/hapi/hapi-17/segments.tap.js index 8abe6bfc77..3501987722 100644 --- a/test/versioned/hapi/hapi-17/segments.tap.js +++ b/test/versioned/hapi/hapi-17/segments.tap.js @@ -20,11 +20,10 @@ var port tap.test('Hapi segments', function(t) { t.autoend() - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() server = utils.getServer() - done() }) t.afterEach(function() { diff --git a/test/versioned/hapi/hapi-17/vhost.tap.js b/test/versioned/hapi/hapi-17/vhost.tap.js index 68d65b0a88..96c02e65ed 100644 --- a/test/versioned/hapi/hapi-17/vhost.tap.js +++ b/test/versioned/hapi/hapi-17/vhost.tap.js @@ -26,7 +26,7 @@ tap.test('Hapi vhost support', function(t) { var server = utils.getServer() var port - t.tearDown(function() { + t.teardown(function() { return server.stop() }) diff --git a/test/versioned/hapi/hapi-post-18/capture-params.tap.js b/test/versioned/hapi/hapi-post-18/capture-params.tap.js index 13ad980e1c..066c96df4d 100644 --- a/test/versioned/hapi/hapi-post-18/capture-params.tap.js +++ b/test/versioned/hapi/hapi-post-18/capture-params.tap.js @@ -19,7 +19,7 @@ tap.test('Hapi capture params support', function(t) { var server = null var port = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent({ attributes: { enabled: true, @@ -30,7 +30,6 @@ tap.test('Hapi capture params support', function(t) { server = utils.getServer() agent.config.attributes.enabled = true - done() }) t.afterEach(function() { diff --git a/test/versioned/hapi/hapi-post-18/errors.tap.js b/test/versioned/hapi/hapi-post-18/errors.tap.js index ceb999a2ac..c90270fac6 100644 --- a/test/versioned/hapi/hapi-post-18/errors.tap.js +++ b/test/versioned/hapi/hapi-post-18/errors.tap.js @@ -17,11 +17,10 @@ var port tap.test('Hapi v17 error handling', function(t) { t.autoend() - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() server = utils.getServer() - done() }) t.afterEach(function() { @@ -218,7 +217,7 @@ function runTest(t, callback) { response.resume() }) }) - t.tearDown(function() { + t.teardown(function() { server.stop() }) } diff --git a/test/versioned/hapi/hapi-post-18/ext.tap.js b/test/versioned/hapi/hapi-post-18/ext.tap.js index d3938bc726..53a1e60667 100644 --- a/test/versioned/hapi/hapi-post-18/ext.tap.js +++ b/test/versioned/hapi/hapi-post-18/ext.tap.js @@ -33,15 +33,14 @@ tap.test('Hapi v17 ext', function(t) { }) } - t.tearDown(function() { + t.teardown(function() { clearInterval(intervalId) }) - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() server = utils.getServer() - done() }) t.afterEach(function() { diff --git a/test/versioned/hapi/hapi-post-18/ignoring.tap.js b/test/versioned/hapi/hapi-post-18/ignoring.tap.js index 9015a11840..d34443178d 100644 --- a/test/versioned/hapi/hapi-post-18/ignoring.tap.js +++ b/test/versioned/hapi/hapi-post-18/ignoring.tap.js @@ -18,7 +18,7 @@ test('ignoring a Hapi route', function(t) { const api = new API(agent) const server = utils.getServer() - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) return server.stop() }) diff --git a/test/versioned/hapi/hapi-post-18/plugins.tap.js b/test/versioned/hapi/hapi-post-18/plugins.tap.js index bd070221cf..b4321fb158 100644 --- a/test/versioned/hapi/hapi-post-18/plugins.tap.js +++ b/test/versioned/hapi/hapi-post-18/plugins.tap.js @@ -26,15 +26,14 @@ tap.test('Hapi Plugins', function(t) { } }, 10) - t.tearDown(function() { + t.teardown(function() { clearInterval(intervalId) }) - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() server = utils.getServer() - done() }) t.afterEach(function() { diff --git a/test/versioned/hapi/hapi-post-18/render.tap.js b/test/versioned/hapi/hapi-post-18/render.tap.js index 1d7c7c6641..3b07cfd7cb 100644 --- a/test/versioned/hapi/hapi-post-18/render.tap.js +++ b/test/versioned/hapi/hapi-post-18/render.tap.js @@ -21,11 +21,10 @@ tap.test('agent instrumentation of Hapi', function(t) { var server = null var port = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() server = utils.getServer() - done() }) t.afterEach(function() { @@ -214,7 +213,7 @@ tap.test('agent instrumentation of Hapi', function(t) { var first = errors[0] t.ok(first, 'have the first error') - t.contains(first[2], 'ohno', 'got the expected error') + t.match(first[2], 'ohno', 'got the expected error') t.end() }) diff --git a/test/versioned/hapi/hapi-post-18/router.tap.js b/test/versioned/hapi/hapi-post-18/router.tap.js index 065e481fb9..ea56b7cafd 100644 --- a/test/versioned/hapi/hapi-post-18/router.tap.js +++ b/test/versioned/hapi/hapi-post-18/router.tap.js @@ -18,7 +18,7 @@ tap.test('Hapi router introspection', function(t) { var server = null var port = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent({ attributes: { enabled: true, @@ -27,8 +27,6 @@ tap.test('Hapi router introspection', function(t) { }) server = utils.getServer() - - done() }) t.afterEach(function() { diff --git a/test/versioned/hapi/hapi-post-18/segments.tap.js b/test/versioned/hapi/hapi-post-18/segments.tap.js index 5ba7084fcb..2875f68c77 100644 --- a/test/versioned/hapi/hapi-post-18/segments.tap.js +++ b/test/versioned/hapi/hapi-post-18/segments.tap.js @@ -20,11 +20,10 @@ var port tap.test('Hapi segments', function(t) { t.autoend() - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() server = utils.getServer() - done() }) t.afterEach(function() { diff --git a/test/versioned/hapi/hapi-post-18/vhost.tap.js b/test/versioned/hapi/hapi-post-18/vhost.tap.js index 2b78b9960a..58c77c0d3b 100644 --- a/test/versioned/hapi/hapi-post-18/vhost.tap.js +++ b/test/versioned/hapi/hapi-post-18/vhost.tap.js @@ -26,7 +26,7 @@ tap.test('Hapi vhost support', function(t) { var server = utils.getServer() var port - t.tearDown(function() { + t.teardown(function() { return server.stop() }) diff --git a/test/versioned/hapi/hapi-pre-17/errors.tap.js b/test/versioned/hapi/hapi-pre-17/errors.tap.js index 5c6e7a6a5a..bcce1523a5 100644 --- a/test/versioned/hapi/hapi-pre-17/errors.tap.js +++ b/test/versioned/hapi/hapi-pre-17/errors.tap.js @@ -17,16 +17,15 @@ var port tap.test('Hapi v16 error handling', function(t) { t.autoend() - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() server = utils.getServer() - done() }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) - server.stop(done) + return server.stop() }) t.test('does not report error when reply is called with a string', function(t) { diff --git a/test/versioned/hapi/hapi-pre-17/ext-v16.tap.js b/test/versioned/hapi/hapi-pre-17/ext-v16.tap.js index dfea0bc616..6091343357 100644 --- a/test/versioned/hapi/hapi-pre-17/ext-v16.tap.js +++ b/test/versioned/hapi/hapi-pre-17/ext-v16.tap.js @@ -26,20 +26,19 @@ tap.test('Hapi.ext', function(t) { } }, 10) - t.tearDown(function() { + t.teardown(function() { clearInterval(intervalId) }) - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() server = utils.getServer() - done() }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) - server.stop(done) + return server.stop() }) t.test('maintains transaction state', function(t) { diff --git a/test/versioned/hapi/hapi-pre-17/ignoring.tap.js b/test/versioned/hapi/hapi-pre-17/ignoring.tap.js index 4a48b2b1e5..a361daccca 100644 --- a/test/versioned/hapi/hapi-pre-17/ignoring.tap.js +++ b/test/versioned/hapi/hapi-pre-17/ignoring.tap.js @@ -20,7 +20,7 @@ tap.test('ignoring a Hapi route', function(t) { var server = utils.getServer() var port = null - t.tearDown(function() { + t.teardown(function() { server.stop(function() { helper.unloadAgent(agent) }) diff --git a/test/versioned/hapi/hapi-pre-17/plugins-v16.tap.js b/test/versioned/hapi/hapi-pre-17/plugins-v16.tap.js index 5d18175f80..ea41d616ad 100644 --- a/test/versioned/hapi/hapi-pre-17/plugins-v16.tap.js +++ b/test/versioned/hapi/hapi-pre-17/plugins-v16.tap.js @@ -26,20 +26,19 @@ tap.test('Hapi Plugins', function(t) { } }, 10) - t.tearDown(function() { + t.teardown(function() { clearInterval(intervalId) }) - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() server = utils.getServer() - done() }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) - server.stop(done) + return server.stop() }) t.test('maintains transaction state', function(t) { diff --git a/test/versioned/hapi/hapi-pre-17/render-v6.tap.js b/test/versioned/hapi/hapi-pre-17/render-v6.tap.js index 19949a2a1c..5e88b5c1a3 100644 --- a/test/versioned/hapi/hapi-pre-17/render-v6.tap.js +++ b/test/versioned/hapi/hapi-pre-17/render-v6.tap.js @@ -21,15 +21,13 @@ test('agent instrumentation of Hapi', function(t) { var agent = null var server = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() - - done() }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) - server.stop(done) + return server.stop() }) t.test('for a normal request', {timeout: 5000}, function(t) { diff --git a/test/versioned/hapi/hapi-pre-17/render-v7.tap.js b/test/versioned/hapi/hapi-pre-17/render-v7.tap.js index 971a654216..42b85c6dbe 100644 --- a/test/versioned/hapi/hapi-pre-17/render-v7.tap.js +++ b/test/versioned/hapi/hapi-pre-17/render-v7.tap.js @@ -21,15 +21,13 @@ tap.test('agent instrumentation of Hapi', function(t) { var agent = null var server = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() - - done() }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) - server.stop(done) + return server.stop() }) t.test('for a normal request', {timeout: 5000}, function(t) { diff --git a/test/versioned/hapi/hapi-pre-17/render-v9.tap.js b/test/versioned/hapi/hapi-pre-17/render-v9.tap.js index d1b44de3a4..4cad385a44 100644 --- a/test/versioned/hapi/hapi-pre-17/render-v9.tap.js +++ b/test/versioned/hapi/hapi-pre-17/render-v9.tap.js @@ -22,15 +22,13 @@ tap.test('agent instrumentation of Hapi', function(t) { var agent = null var port = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() - - done() }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) - server.stop(done) + return server.stop() }) t.test('for a normal request', {timeout: 5000}, function(t) { @@ -213,7 +211,7 @@ tap.test('agent instrumentation of Hapi', function(t) { var first = errors[0] t.ok(first, 'have the first error') - t.contains(first[2], 'ohno', 'got the expected error') + t.match(first[2], 'ohno', 'got the expected error') t.end() }) diff --git a/test/versioned/hapi/hapi-pre-17/render.tap.js b/test/versioned/hapi/hapi-pre-17/render.tap.js index 1fc07991b5..11820454a9 100644 --- a/test/versioned/hapi/hapi-pre-17/render.tap.js +++ b/test/versioned/hapi/hapi-pre-17/render.tap.js @@ -21,15 +21,13 @@ tap.test('agent instrumentation of Hapi', function(t) { var agent = null var server = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() - - done() }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) - server.stop(done) + return server.stop() }) t.test('for a normal request', {timeout: 5000}, function(t) { diff --git a/test/versioned/hapi/hapi-pre-17/router-v16.tap.js b/test/versioned/hapi/hapi-pre-17/router-v16.tap.js index bb3f150dce..6473abadd1 100644 --- a/test/versioned/hapi/hapi-pre-17/router-v16.tap.js +++ b/test/versioned/hapi/hapi-pre-17/router-v16.tap.js @@ -17,7 +17,7 @@ tap.test('Hapi router introspection', function(t) { var server = null var port = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent({ attributes: { enabled: true, @@ -26,13 +26,11 @@ tap.test('Hapi router introspection', function(t) { }) server = utils.getServer() - - done() }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) - server.stop(done) + return server.stop() }) t.test('using route handler - simple case', function(t) { diff --git a/test/versioned/hapi/hapi-pre-17/router.tap.js b/test/versioned/hapi/hapi-pre-17/router.tap.js index 004c0ff290..c17083054a 100644 --- a/test/versioned/hapi/hapi-pre-17/router.tap.js +++ b/test/versioned/hapi/hapi-pre-17/router.tap.js @@ -17,7 +17,7 @@ tap.test('Hapi router introspection', function(t) { var server = null var port = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent({ attributes: { enabled: true, @@ -26,13 +26,11 @@ tap.test('Hapi router introspection', function(t) { }) server = utils.getServer() - - done() }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) - server.stop(done) + return server.stop() }) t.test('simple case using server.route', function(t) { diff --git a/test/versioned/hapi/hapi-pre-17/segments-v16.tap.js b/test/versioned/hapi/hapi-pre-17/segments-v16.tap.js index cfbcda7d5a..bdaff1e21f 100644 --- a/test/versioned/hapi/hapi-pre-17/segments-v16.tap.js +++ b/test/versioned/hapi/hapi-pre-17/segments-v16.tap.js @@ -20,16 +20,15 @@ var port tap.test('Hapi v16 segments', function(t) { t.autoend() - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() server = utils.getServer() - done() }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) - server.stop(done) + return server.stop() }) t.test('route handler is recorded as middleware', function(t) { diff --git a/test/versioned/hapi/hapi-pre-17/vhost.tap.js b/test/versioned/hapi/hapi-pre-17/vhost.tap.js index ce6c389856..dc8f575b85 100644 --- a/test/versioned/hapi/hapi-pre-17/vhost.tap.js +++ b/test/versioned/hapi/hapi-pre-17/vhost.tap.js @@ -24,7 +24,7 @@ tap.test('Hapi vhost support', function(t) { // disabled by default agent.config.attributes.enabled = true - t.tearDown(function() { + t.teardown(function() { server.stop(function() { helper.unloadAgent(agent) }) diff --git a/test/versioned/ioredis/ioredis-3.tap.js b/test/versioned/ioredis/ioredis-3.tap.js index c9374f752d..a3488a6ac9 100644 --- a/test/versioned/ioredis/ioredis-3.tap.js +++ b/test/versioned/ioredis/ioredis-3.tap.js @@ -16,22 +16,16 @@ const DB_INDEX = 4 tap.test('ioredis instrumentation', function(t) { var agent, redisClient - t.beforeEach(function(done) { - setup(t, function(error, result) { - if (error) { - return done(error) - } - + t.beforeEach(function() { + return setup(t).then((result) => { agent = result.agent redisClient = result.client - done() }) }) - t.afterEach(function(done) { + t.afterEach(function() { agent && helper.unloadAgent(agent) redisClient && redisClient.disconnect() - done() }) t.test('creates expected metrics', {timeout : 5000}, function(t) { @@ -102,34 +96,36 @@ tap.test('ioredis instrumentation', function(t) { }) -function setup(t, callback) { - helper.flushRedisDb(DB_INDEX, (error) => { - if (error) { - return callback(error) - } +function setup(t) { + return new Promise((resolve, reject) => { + helper.flushRedisDb(DB_INDEX, (error) => { + if (error) { + return reject(error) + } - const agent = helper.instrumentMockedAgent() + const agent = helper.instrumentMockedAgent() - // remove from cache, so that the bluebird library that ioredis uses gets - // re-instrumented - clearLoadedModules(t) + // remove from cache, so that the bluebird library that ioredis uses gets + // re-instrumented + clearLoadedModules(t) - let Redis = null - try { - Redis = require('ioredis') - } catch (err) { - return callback(err) - } + let Redis = null + try { + Redis = require('ioredis') + } catch (err) { + return reject(err) + } - const client = new Redis(params.redis_port, params.redis_host) + const client = new Redis(params.redis_port, params.redis_host) - client.once('ready', () => { - client.select(DB_INDEX, (err) => { - if (err) { - return callback(err) - } + client.once('ready', () => { + client.select(DB_INDEX, (err) => { + if (err) { + return reject(err) + } - callback(null, {agent, client}) + resolve({agent, client}) + }) }) }) }) diff --git a/test/versioned/ioredis/ioredis.tap.js b/test/versioned/ioredis/ioredis.tap.js index d4bc9b37db..ae3bf179fb 100644 --- a/test/versioned/ioredis/ioredis.tap.js +++ b/test/versioned/ioredis/ioredis.tap.js @@ -18,39 +18,40 @@ tap.test('ioredis instrumentation', (t) => { let redisClient = null t.autoend() - t.beforeEach((done) => { - helper.flushRedisDb(DB_INDEX, (error) => { - if (error) { - return done(error) - } - - agent = helper.instrumentMockedAgent() - - let Redis = null - try { - Redis = require('ioredis') - } catch (err) { - return done(err) - } - - redisClient = new Redis(params.redis_port, params.redis_host) - - redisClient.once('ready', () => { - redisClient.select(DB_INDEX, (err) => { - if (err) { - return done(err) - } - - done() + t.beforeEach(() => { + return new Promise((resolve, reject) => { + helper.flushRedisDb(DB_INDEX, (error) => { + if (error) { + return reject(error) + } + + agent = helper.instrumentMockedAgent() + + let Redis = null + try { + Redis = require('ioredis') + } catch (err) { + return reject(err) + } + + redisClient = new Redis(params.redis_port, params.redis_host) + + redisClient.once('ready', () => { + redisClient.select(DB_INDEX, (err) => { + if (err) { + return reject(err) + } + + resolve() + }) }) }) }) }) - t.afterEach((done) => { + t.afterEach(() => { agent && helper.unloadAgent(agent) redisClient && redisClient.disconnect() - done() }) t.test('creates expected metrics', {timeout: 5000}, (t) => { @@ -119,3 +120,4 @@ tap.test('ioredis instrumentation', (t) => { }) }) }) + diff --git a/test/versioned/mongodb/collection-common.js b/test/versioned/mongodb/collection-common.js index a54c49e561..8fc794e503 100644 --- a/test/versioned/mongodb/collection-common.js +++ b/test/versioned/mongodb/collection-common.js @@ -37,36 +37,29 @@ function collectionTest(name, run) { t.test('remote connection', function(t) { t.autoend() - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() var mongodb = require('mongodb') - dropTestCollections(mongodb, collections, function(err) { - if (err) { - return done(err) - } - - METRIC_HOST_NAME = common.getHostName(agent) - METRIC_HOST_PORT = common.getPort() - common.connect(mongodb, null, function(err, res) { - if (err) { - return done(err) - } - + return dropTestCollections(mongodb, collections) + .then(() => { + METRIC_HOST_NAME = common.getHostName(agent) + METRIC_HOST_PORT = common.getPort() + return common.connect(mongodb) + }) + .then((res) => { client = res.client db = res.db collection = db.collection('testCollection') - populate(db, collection, done) + return populate(db, collection) }) - }) }) - t.afterEach(function(done) { - common.close(client, db, function(err) { + t.afterEach(function() { + return common.close(client, db).then(() => { helper.unloadAgent(agent) agent = null - done(err) }) }) @@ -204,37 +197,29 @@ function collectionTest(name, run) { var shouldTestDomain = domainPath || process.env.TRAVIS t.test('domain socket', {skip: !shouldTestDomain}, function(t) { t.autoend() - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() METRIC_HOST_NAME = agent.config.getHostnameSafe() METRIC_HOST_PORT = domainPath var mongodb = require('mongodb') - dropTestCollections(mongodb, collections, function(err) { - if (err) { - return done(err) - } - - common.connect(mongodb, domainPath, function(err, res) { - if (err) { - return done(err) - } - + return dropTestCollections(mongodb, collections) + .then(() => { + return common.connect(mongodb, domainPath) + }) + .then((res) => { client = res.client db = res.db - collection = db.collection('testCollection') - populate(db, collection, done) + return populate(db, collection) }) - }) }) - t.afterEach(function(done) { - common.close(client, db, function(err) { + t.afterEach(function() { + return common.close(client, db).then(() => { helper.unloadAgent(agent) agent = null - done(err) }) }) @@ -278,26 +263,28 @@ function checkSegmentParams(t, segment) { t.equal(attributes.port_path_or_id, METRIC_HOST_PORT, 'should have correct port') } -function populate(db, collection, done) { - var items = [] - for (var i = 0; i < 30; ++i) { - items.push({ - i: i, - next3: [i + 1, i + 2, i + 3], - data: Math.random().toString(36).slice(2), - mod10: i % 10, - // spiral out - loc: [ - (i % 4 && (i + 1) % 4 ? i : -i), - ((i + 1) % 4 && (i + 2) % 4 ? i : -i) - ] - }) - } +function populate(db, collection) { + return new Promise((resolve, reject) => { + var items = [] + for (var i = 0; i < 30; ++i) { + items.push({ + i: i, + next3: [i + 1, i + 2, i + 3], + data: Math.random().toString(36).slice(2), + mod10: i % 10, + // spiral out + loc: [ + (i % 4 && (i + 1) % 4 ? i : -i), + ((i + 1) % 4 && (i + 2) % 4 ? i : -i) + ] + }) + } - db.collection('testCollection2').drop(function() { - collection.deleteMany({}, function(err) { - if (err) return done(err) - collection.insert(items, done) + db.collection('testCollection2').drop(function() { + collection.deleteMany({}, function(err) { + if (err) reject(err) + collection.insert(items, resolve) + }) }) }) } @@ -307,15 +294,9 @@ function populate(db, collection, done) { * by tests. * @param {*} mongodb MongoDB module to execute commands on. * @param {*} collections Collections to drop for test. - * @param {Function} callback The operations to be performed while the server - * is running. */ -function dropTestCollections(mongodb, collections, callback) { - common.connect(mongodb, null, function(err, res) { - if (err) { - return callback(err) - } - +function dropTestCollections(mongodb, collections) { + return common.connect(mongodb).then((res) => { const client = res.client const db = res.db @@ -329,9 +310,10 @@ function dropTestCollections(mongodb, collections, callback) { cb(err) }) }, (err) => { - common.close(client, db, (err2) => { - callback(err || err2) - }) + return common.close(client, db) + .catch((err2) => { + throw err || err2 + }) }) }) } diff --git a/test/versioned/mongodb/common.js b/test/versioned/mongodb/common.js index c0f2bfb15c..495c64c67b 100644 --- a/test/versioned/mongodb/common.js +++ b/test/versioned/mongodb/common.js @@ -30,50 +30,60 @@ exports.getHostName = getHostName exports.getPort = getPort exports.getDomainSocketPath = getDomainSocketPath -function connectV2(mongodb, path, cb) { - var server = null - if (path) { - server = new mongodb.Server(path) - } else { - server = new mongodb.Server(params.mongodb_host, params.mongodb_port, { - socketOptions: { - connectionTimeoutMS: 30000, - socketTimeoutMS: 30000 - } - }) - } +function connectV2(mongodb, path) { + return new Promise((resolve, reject) => { + var server = null + if (path) { + server = new mongodb.Server(path) + } else { + server = new mongodb.Server(params.mongodb_host, params.mongodb_port, { + socketOptions: { + connectionTimeoutMS: 30000, + socketTimeoutMS: 30000 + } + }) + } + + var db = new mongodb.Db(DB_NAME, server) - var db = new mongodb.Db(DB_NAME, server) + db.open(function(err) { + if (err) { + reject(err) + } - db.open(function(err) { - cb(err, {db: db, client: null}) + resolve({ db, client: null }) + }) }) } -function connectV3(mongodb, host, cb) { - if (host) { - host = encodeURIComponent(host) - } else { - host = params.mongodb_host + ':' + params.mongodb_port - } - mongodb.MongoClient.connect('mongodb://' + host, function(err, client) { - if (err) { - return cb(err) +function connectV3(mongodb, host) { + return new Promise((resolve, reject) => { + if (host) { + host = encodeURIComponent(host) + } else { + host = params.mongodb_host + ':' + params.mongodb_port } + mongodb.MongoClient.connect('mongodb://' + host, function(err, client) { + if (err) { + reject(err) + } - var db = client.db(DB_NAME) - cb(null, {db: db, client: client}) + var db = client.db(DB_NAME) + resolve({ db, client }) + }) }) } -function close(client, db, cb) { - if (db && typeof db.close === 'function') { - db.close(cb) - } else if (client) { - client.close(true, cb) - } else { - cb() - } +function close(client, db) { + return new Promise((resolve) => { + if (db && typeof db.close === 'function') { + db.close(resolve) + } else if (client) { + client.close(true, resolve) + } else { + resolve() + } + }) } function getHostName(agent) { diff --git a/test/versioned/mongodb/cursor.tap.js b/test/versioned/mongodb/cursor.tap.js index bbf2b3333b..8bfebdb9b9 100644 --- a/test/versioned/mongodb/cursor.tap.js +++ b/test/versioned/mongodb/cursor.tap.js @@ -91,30 +91,27 @@ tap.test('piping cursor stream hides internal calls', function(t) { var db = null var collection = null - t.tearDown(function() { - common.close(client, db, function() {}) - helper.unloadAgent(agent) - agent = null + t.teardown(function() { + return common.close(client, db) + .then(() => { + helper.unloadAgent(agent) + agent = null + }) }) var mongodb = require('mongodb') - common.dropTestCollections(mongodb, ['testCollection'], function(err) { - if (!t.error(err)) { - return t.end() - } - - common.connect(mongodb, null, function(err, res) { - if (!t.error(err)) { - return t.end() - } - + common.dropTestCollections(mongodb, ['testCollection']) + .then(() => { + return common.connect(mongodb) + }) + .then((res) => { client = res.client db = res.db collection = db.collection('testCollection') - common.populate(db, collection, runTest) + return common.populate(db, collection) }) - }) + .then(runTest) function runTest() { helper.runInTransaction(agent, function(transaction) { diff --git a/test/versioned/mongodb/db.tap.js b/test/versioned/mongodb/db.tap.js index 59dbc04e0f..c72272ad3c 100644 --- a/test/versioned/mongodb/db.tap.js +++ b/test/versioned/mongodb/db.tap.js @@ -292,19 +292,19 @@ function dbTest(name, collections, run) { t.test('remote connection', function(t) { t.autoend() - t.beforeEach(function(done) { + t.beforeEach(function() { MONGO_HOST = common.getHostName(agent) MONGO_PORT = common.getPort() - common.connect(mongodb, null, function(err, res) { - client = res.client - db = res.db - done(err) - }) + return common.connect(mongodb) + .then((res) => { + client = res.client + db = res.db + }) }) - t.afterEach(function(done) { - common.close(client, db, done) + t.afterEach(function() { + return common.close(client, db) }) t.test('without transaction', function(t) { @@ -331,21 +331,20 @@ function dbTest(name, collections, run) { // the same box as these tests. This should always be the case on Travis, // but just to be sure they're running there check for the environment flag. var shouldTestDomain = domainPath || process.env.TRAVIS + t.test('domain socket', {skip: !shouldTestDomain}, function(t) { t.autoend() - t.beforeEach(function(done) { + t.beforeEach(async function() { MONGO_HOST = LOCALHOST MONGO_PORT = domainPath - common.connect(mongodb, domainPath, function(err, res) { - client = res.client - db = res.db - done(err) - }) + const res = await common.connect(mongodb, domainPath) + client = res.client + db = res.db }) - t.afterEach(function(done) { - common.close(client, db, done) + t.afterEach(function() { + return common.close(client, db) }) t.test('with transaction', function(t) { diff --git a/test/versioned/mysql/basic-pool.tap.js b/test/versioned/mysql/basic-pool.tap.js index 1c8cbb1e0b..e09446b475 100644 --- a/test/versioned/mysql/basic-pool.tap.js +++ b/test/versioned/mysql/basic-pool.tap.js @@ -35,10 +35,8 @@ function getConfig(extras) { } tap.test('See if mysql is running', function(t) { - setup(require('mysql'), function(err) { - t.error(err, 'should not fail to set up mysql database') - t.end() - }) + t.resolves(setup(require('mysql'))) + t.end() }) tap.test('bad config', function(t) { @@ -55,7 +53,7 @@ tap.test('bad config', function(t) { t.test(function(t) { var poolCluster = mysql.createPoolCluster() - t.tearDown(function() { poolCluster.end() }) + t.teardown(function() { poolCluster.end() }) poolCluster.add(badConfig) // anonymous group poolCluster.getConnection(function(err) { @@ -75,7 +73,7 @@ tap.test('bad config', function(t) { }) }) - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) }) @@ -90,20 +88,22 @@ tap.test('mysql built-in connection pools', {timeout : 30 * 1000}, function(t) { var mysql = null var pool = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() mysql = require('mysql') pool = mysql.createPool(config) - setup(mysql, done) + return setup(mysql) }) - t.afterEach(function(done) { - helper.unloadAgent(agent) - pool.end(done) + t.afterEach(function() { + return new Promise((resolve) => { + helper.unloadAgent(agent) + pool.end(resolve) - agent = null - mysql = null - pool = null + agent = null + mysql = null + pool = null + }) }) // make sure a connection exists in the pool before any tests are run @@ -345,7 +345,7 @@ tap.test('mysql built-in connection pools', {timeout : 30 * 1000}, function(t) { pool.getConnection(function shouldBeWrapped(err, connection) { t.ifError(err, 'should not have error') t.ok(agent.getTransaction(), 'transaction should exit') - t.tearDown(function() { connection.release() }) + t.teardown(function() { connection.release() }) connection.query('SELECT 1 + 1 AS solution', function(err) { var transxn = agent.getTransaction() @@ -369,7 +369,7 @@ tap.test('mysql built-in connection pools', {timeout : 30 * 1000}, function(t) { pool.getConnection(function shouldBeWrapped(err, connection) { t.ifError(err, 'should not have error') t.ok(agent.getTransaction(), 'transaction should exit') - t.tearDown(function() { connection.release() }) + t.teardown(function() { connection.release() }) connection.query('SELECT ? + ? AS solution', [1,1], function(err) { var transxn = agent.getTransaction() @@ -447,19 +447,17 @@ tap.test('poolCluster', {timeout : 30 * 1000}, function(t) { var agent = null var mysql = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() mysql = require('mysql') - setup(mysql, done) + return setup(mysql) }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) agent = null mysql = null - - done() }) t.test('primer', function(t) { diff --git a/test/versioned/mysql/basic.tap.js b/test/versioned/mysql/basic.tap.js index e2a76b9796..8efaf60e52 100644 --- a/test/versioned/mysql/basic.tap.js +++ b/test/versioned/mysql/basic.tap.js @@ -24,19 +24,21 @@ tap.test('Basic run through mysql functionality', {timeout : 30 * 1000}, functio var poolLogger = logger.child({component : 'pool'}) var pool = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() mysql = require('mysql') pool = setup.pool(mysql, poolLogger) - setup(mysql, done) + return setup(mysql) }) - t.afterEach(function(done) { - pool.drain(function() { - pool.destroyAllNow() - helper.unloadAgent(agent) - done() + t.afterEach(function() { + return new Promise((resolve) => { + pool.drain(function() { + pool.destroyAllNow() + helper.unloadAgent(agent) + resolve() + }) }) }) diff --git a/test/versioned/mysql/pooling.tap.js b/test/versioned/mysql/pooling.tap.js index 9ca328597b..647e8880f8 100644 --- a/test/versioned/mysql/pooling.tap.js +++ b/test/versioned/mysql/pooling.tap.js @@ -25,7 +25,7 @@ tap.test('MySQL instrumentation with a connection pool', {timeout : 30000}, func var mysql = require('mysql') var pool = setup.pool(mysql, poolLogger) - t.tearDown(function() { + t.teardown(function() { pool.drain(function() { pool.destroyAllNow() helper.unloadAgent(agent) @@ -80,8 +80,7 @@ tap.test('MySQL instrumentation with a connection pool', {timeout : 30000}, func } } - setup(mysql, function(err) { - t.error(err, 'should not error setting up test') + setup(mysql).then(() => { t.notOk(agent.getTransaction(), 'no transaction should be in play yet') helper.runInTransaction(agent, function transactionInScope() { var context = { diff --git a/test/versioned/mysql/setup.js b/test/versioned/mysql/setup.js index 8b15e7de36..a432707d46 100644 --- a/test/versioned/mysql/setup.js +++ b/test/versioned/mysql/setup.js @@ -12,8 +12,8 @@ var params = require('../../lib/params') module.exports = exports = setup exports.pool = setupPool -function setup(mysql, cb) { - a.series([ +function setup(mysql) { + return a.series([ // 1. Create the user and database as root. function(cb) { var client = mysql.createConnection({ @@ -70,7 +70,7 @@ function setup(mysql, cb) { cb(err) }) } - ], cb) + ]) } function setupPool(mysql, logger) { diff --git a/test/versioned/mysql/transactions.tap.js b/test/versioned/mysql/transactions.tap.js index a917c243c8..af371b4cdc 100644 --- a/test/versioned/mysql/transactions.tap.js +++ b/test/versioned/mysql/transactions.tap.js @@ -16,15 +16,13 @@ var DBNAME = 'agent_integration' tap.test('MySQL transactions', {timeout : 30000}, function(t) { - t.plan(7) + t.plan(6) // set up the instrumentation before loading MySQL var agent = helper.instrumentMockedAgent() var mysql = require('mysql') - setup(mysql, function(error) { - t.error(error, 'should not error setting up database') - + setup(mysql).then(() => { var client = mysql.createConnection({ user: DBUSER, database: DBNAME, @@ -32,7 +30,7 @@ tap.test('MySQL transactions', {timeout : 30000}, function(t) { port: params.mysql_port }) - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) client.end() }) diff --git a/test/versioned/mysql2/basic-pool.tap.js b/test/versioned/mysql2/basic-pool.tap.js index 115c7043df..cf42ac6ac4 100644 --- a/test/versioned/mysql2/basic-pool.tap.js +++ b/test/versioned/mysql2/basic-pool.tap.js @@ -35,10 +35,8 @@ function getConfig(extras) { } tap.test('See if mysql is running', function(t) { - setup(require('mysql2'), function(err) { - t.error(err, 'should not fail to set up mysql database') - t.end() - }) + t.resolves(setup(require('mysql2'))) + t.end() }) tap.test('bad config', function(t) { @@ -55,7 +53,7 @@ tap.test('bad config', function(t) { t.test(function(t) { var poolCluster = mysql.createPoolCluster() - t.tearDown(function() { poolCluster.end() }) + t.teardown(function() { poolCluster.end() }) poolCluster.add(badConfig) // anonymous group poolCluster.getConnection(function(err) { @@ -75,7 +73,7 @@ tap.test('bad config', function(t) { }) }) - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) }) }) @@ -92,20 +90,22 @@ tap.test('mysql2 built-in connection pools', {timeout : 30 * 1000}, function(t) var mysql = null var pool = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() mysql = require('mysql2') pool = mysql.createPool(config) - setup(mysql, done) + return setup(mysql) }) - t.afterEach(function(done) { - helper.unloadAgent(agent) - pool.end(done) + t.afterEach(function() { + return new Promise((resolve) => { + helper.unloadAgent(agent) + pool.end(resolve) - agent = null - mysql = null - pool = null + agent = null + mysql = null + pool = null + }) }) // make sure a connection exists in the pool before any tests are run @@ -392,7 +392,7 @@ tap.test('mysql2 built-in connection pools', {timeout : 30 * 1000}, function(t) pool.getConnection(function shouldBeWrapped(err, connection) { t.ifError(err, 'should not have error') t.ok(agent.getTransaction(), 'transaction should exit') - t.tearDown(function() { connection.release() }) + t.teardown(function() { connection.release() }) connection.query('SELECT 1 + 1 AS solution', function(err) { var transxn = agent.getTransaction() @@ -416,7 +416,7 @@ tap.test('mysql2 built-in connection pools', {timeout : 30 * 1000}, function(t) pool.getConnection(function shouldBeWrapped(err, connection) { t.ifError(err, 'should not have error') t.ok(agent.getTransaction(), 'transaction should exit') - t.tearDown(function() { connection.release() }) + t.teardown(function() { connection.release() }) connection.query('SELECT ? + ? AS solution', [1,1], function(err) { var transxn = agent.getTransaction() @@ -444,19 +444,17 @@ tap.test('poolCluster', {timeout : 30 * 1000}, function(t) { var agent = null var mysql = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() mysql = require('mysql2') - setup(mysql, done) + return setup(mysql) }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) agent = null mysql = null - - done() }) t.test('primer', function(t) { diff --git a/test/versioned/mysql2/basic.tap.js b/test/versioned/mysql2/basic.tap.js index c59840fd1c..5e09d86902 100644 --- a/test/versioned/mysql2/basic.tap.js +++ b/test/versioned/mysql2/basic.tap.js @@ -23,19 +23,21 @@ tap.test('Basic run through mysql functionality', {timeout: 30 * 1000}, function var poolLogger = logger.child({component: 'pool'}) var pool = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent() mysql = require('mysql2') pool = setup.pool(mysql, poolLogger) - setup(mysql, done) + return setup(mysql) }) - t.afterEach(function(done) { - pool.drain(function() { - pool.destroyAllNow() - helper.unloadAgent(agent) - done() + t.afterEach(function() { + return new Promise((resolve) => { + pool.drain(function() { + pool.destroyAllNow() + helper.unloadAgent(agent) + resolve() + }) }) }) diff --git a/test/versioned/mysql2/pooling.tap.js b/test/versioned/mysql2/pooling.tap.js index 40d7d3ce2b..2573ba36fa 100644 --- a/test/versioned/mysql2/pooling.tap.js +++ b/test/versioned/mysql2/pooling.tap.js @@ -20,7 +20,7 @@ tap.test('MySQL2 instrumentation with a connection pool', {timeout: 60000}, func var mysql = require('mysql2') var pool = setup.pool(mysql, poolLogger) - t.tearDown(function() { + t.teardown(function() { pool.drain(function() { pool.destroyAllNow() helper.unloadAgent(agent) @@ -74,8 +74,7 @@ tap.test('MySQL2 instrumentation with a connection pool', {timeout: 60000}, func } } - setup(mysql, function(err) { - t.error(err, 'should not error setting up test') + setup(mysql).then(() => { t.notOk(agent.getTransaction(), 'no transaction should be in play yet') helper.runInTransaction(agent, function transactionInScope() { dal.lookup({id: 1}, function(error, row) { diff --git a/test/versioned/mysql2/setup.js b/test/versioned/mysql2/setup.js index 6472cf0781..1d85e9ad05 100644 --- a/test/versioned/mysql2/setup.js +++ b/test/versioned/mysql2/setup.js @@ -12,8 +12,8 @@ var params = require('../../lib/params') module.exports = exports = setup exports.pool = setupPool -function setup(mysql, cb) { - a.series([ +function setup(mysql) { + return a.series([ // 1. Create the user and database as root. function(cb) { var client = mysql.createConnection({ @@ -70,7 +70,7 @@ function setup(mysql, cb) { cb(err) }) } - ], cb) + ]) } function setupPool(mysql, logger) { diff --git a/test/versioned/mysql2/transaction.tap.js b/test/versioned/mysql2/transaction.tap.js index 73b99a5440..3286e3e8f8 100644 --- a/test/versioned/mysql2/transaction.tap.js +++ b/test/versioned/mysql2/transaction.tap.js @@ -14,15 +14,13 @@ var DBUSER = 'test_user' var DBNAME = 'agent_integration' tap.test('MySQL transactions', {timeout: 30000}, function(t) { - t.plan(4) + t.plan(3) // set up the instrumentation before loading MySQL var agent = helper.instrumentMockedAgent() var mysql = require('mysql2') - setup(mysql, function(error) { - t.error(error, 'should not error setting up database') - + setup(mysql).then(() => { var client = mysql.createConnection({ user: DBUSER, database: DBNAME, @@ -30,7 +28,7 @@ tap.test('MySQL transactions', {timeout: 30000}, function(t) { port: params.mysql_port }) - t.tearDown(function() { + t.teardown(function() { helper.unloadAgent(agent) client.end() }) diff --git a/test/versioned/pg/pg-post-7/pg.common.js b/test/versioned/pg/pg-post-7/pg.common.js index 59fc91c79a..e949d27cee 100644 --- a/test/versioned/pg/pg-post-7/pg.common.js +++ b/test/versioned/pg/pg-post-7/pg.common.js @@ -30,38 +30,37 @@ module.exports = function runTests(name, clientFactory) { /** * Deletion of testing table if already exists, * then recreation of a testing table - * - * - * @param Callback function to set off running the tests */ - function postgresSetup(runTest) { + function postgresSetup() { var pg = clientFactory() var setupClient = new pg.Client(CON_OBJ) - setupClient.connect(function(err) { - if (err) { - throw err - } - var tableDrop = 'DROP TABLE IF EXISTS ' + TABLE_PREPARED - - var tableCreate = - 'CREATE TABLE ' + TABLE_PREPARED + ' (' + - PK + ' integer PRIMARY KEY, ' + - COL + ' text' + - ');' - - a.eachSeries([ - 'set client_min_messages=\'warning\';', // supress PG notices - tableDrop, - tableCreate - ], function(query, cb) { - setupClient.query(query, cb) - }, function(err) { + return new Promise((resolve, reject) => { + setupClient.connect(function(err) { if (err) { - throw err + reject(err) } - setupClient.end() - runTest() + var tableDrop = 'DROP TABLE IF EXISTS ' + TABLE_PREPARED + + var tableCreate = + 'CREATE TABLE ' + TABLE_PREPARED + ' (' + + PK + ' integer PRIMARY KEY, ' + + COL + ' text' + + ');' + + a.eachSeries([ + 'set client_min_messages=\'warning\';', // supress PG notices + tableDrop, + tableCreate + ], function(query, cb) { + setupClient.query(query, cb) + }, function(err) { + if (err) { + reject(err) + } + setupClient.end() + resolve() + }) }) }) } @@ -219,7 +218,7 @@ module.exports = function runTests(name, clientFactory) { var agent = null var pg = null - t.beforeEach(function(done) { + t.beforeEach(function() { // the pg module has `native` lazy getter that is removed after first call, // so in order to re-instrument, we need to remove the pg module from the cache var pgName = require.resolve('pg') @@ -228,20 +227,19 @@ module.exports = function runTests(name, clientFactory) { agent = helper.instrumentMockedAgent() pg = clientFactory() - postgresSetup(done) + return postgresSetup() }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) agent = null pg = null - done() }) t.test('simple query with prepared statement', function(t) { var client = new pg.Client(CON_OBJ) - t.tearDown(function() { + t.teardown(function() { client.end() }) @@ -392,7 +390,7 @@ module.exports = function runTests(name, clientFactory) { t.plan(3) var client = new pg.Client(CON_OBJ) - t.tearDown(function() { + t.teardown(function() { client.end() }) @@ -446,7 +444,7 @@ module.exports = function runTests(name, clientFactory) { var client = new pg.Client(CON_OBJ) - t.tearDown(function() { + t.teardown(function() { client.end() }) @@ -484,7 +482,7 @@ module.exports = function runTests(name, clientFactory) { var client = new pg.Client(CON_OBJ) - t.tearDown(function() { + t.teardown(function() { client.end() }) diff --git a/test/versioned/pg/pg-pre-7/pg.common.js b/test/versioned/pg/pg-pre-7/pg.common.js index 098d83c371..9b1421dad4 100644 --- a/test/versioned/pg/pg-pre-7/pg.common.js +++ b/test/versioned/pg/pg-pre-7/pg.common.js @@ -30,38 +30,37 @@ module.exports = function runTests(name, clientFactory) { /** * Deletion of testing table if already exists, * then recreation of a testing table - * - * - * @param Callback function to set off running the tests */ - function postgresSetup(runTest) { + function postgresSetup() { var pg = clientFactory() var setupClient = new pg.Client(CON_OBJ) - setupClient.connect(function(err) { - if (err) { - throw err - } - var tableDrop = 'DROP TABLE IF EXISTS ' + TABLE_PREPARED - - var tableCreate = - 'CREATE TABLE ' + TABLE_PREPARED + ' (' + - PK + ' integer PRIMARY KEY, ' + - COL + ' text' + - ');' - - a.eachSeries([ - 'set client_min_messages=\'warning\';', // supress PG notices - tableDrop, - tableCreate - ], function(query, cb) { - setupClient.query(query, cb) - }, function(err) { + return new Promise((resolve, reject) => { + setupClient.connect(function(err) { if (err) { - throw err + reject(err) } - setupClient.end() - runTest() + var tableDrop = 'DROP TABLE IF EXISTS ' + TABLE_PREPARED + + var tableCreate = + 'CREATE TABLE ' + TABLE_PREPARED + ' (' + + PK + ' integer PRIMARY KEY, ' + + COL + ' text' + + ');' + + a.eachSeries([ + 'set client_min_messages=\'warning\';', // supress PG notices + tableDrop, + tableCreate + ], function(query, cb) { + setupClient.query(query, cb) + }, function(err) { + if (err) { + reject(err) + } + setupClient.end() + resolve() + }) }) }) } @@ -237,7 +236,7 @@ module.exports = function runTests(name, clientFactory) { var agent = null var pg = null - t.beforeEach(function(done) { + t.beforeEach(function() { // the pg module has `native` lazy getter that is removed after first call, // so in order to re-instrument, we need to remove the pg module from the cache var pgResolved = require.resolve('pg') @@ -246,20 +245,19 @@ module.exports = function runTests(name, clientFactory) { agent = helper.instrumentMockedAgent() pg = clientFactory() - postgresSetup(done) + return postgresSetup() }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) agent = null pg = null - done() }) t.test('simple query with prepared statement', function(t) { var client = new pg.Client(CON_OBJ) - t.tearDown(function() { + t.teardown(function() { client.end() }) @@ -311,7 +309,7 @@ module.exports = function runTests(name, clientFactory) { t.plan(36) var client = new pg.Client(CON_OBJ) - t.tearDown(function() { + t.teardown(function() { client.end() }) @@ -367,7 +365,7 @@ module.exports = function runTests(name, clientFactory) { t.plan(36) var client = new pg.Client(CON_OBJ) - t.tearDown(function() { + t.teardown(function() { client.end() }) @@ -525,7 +523,7 @@ module.exports = function runTests(name, clientFactory) { t.plan(3) var client = new pg.Client(CON_OBJ) - t.tearDown(function() { + t.teardown(function() { client.end() }) @@ -579,7 +577,7 @@ module.exports = function runTests(name, clientFactory) { var client = new pg.Client(CON_OBJ) - t.tearDown(function() { + t.teardown(function() { client.end() }) @@ -612,7 +610,7 @@ module.exports = function runTests(name, clientFactory) { var client = new pg.Client(CON_OBJ) - t.tearDown(function() { + t.teardown(function() { client.end() }) @@ -651,7 +649,7 @@ module.exports = function runTests(name, clientFactory) { var client = new pg.Client(CON_OBJ) - t.tearDown(function() { + t.teardown(function() { client.end() }) @@ -696,7 +694,7 @@ module.exports = function runTests(name, clientFactory) { t.plan(2) var client = new pg.Client(CON_OBJ) - t.tearDown(function() { + t.teardown(function() { client.end() }) @@ -719,7 +717,7 @@ module.exports = function runTests(name, clientFactory) { t.test('query.on should create one segment for row events', function(t) { helper.runInTransaction(agent, function transactionInScope(tx) { var client = new pg.Client(CON_OBJ) - t.tearDown(function() { + t.teardown(function() { client.end() }) @@ -747,7 +745,7 @@ module.exports = function runTests(name, clientFactory) { helper.runInTransaction(agent, function transactionInScope(tx) { var client = new pg.Client(CON_OBJ) - t.tearDown(function() { + t.teardown(function() { client.end() }) @@ -783,7 +781,7 @@ module.exports = function runTests(name, clientFactory) { helper.runInTransaction(agent, function transactionInScope(tx) { var client = new pg.Client(CON_OBJ) - t.tearDown(function() { + t.teardown(function() { client.end() }) @@ -829,7 +827,7 @@ module.exports = function runTests(name, clientFactory) { helper.runInTransaction(agent, function transactionInScope(tx) { var client = new pg.Client(CON_OBJ) - t.tearDown(function() { + t.teardown(function() { client.end() }) diff --git a/test/versioned/redis/redis.tap.js b/test/versioned/redis/redis.tap.js index f23e07301a..ddc931cd8b 100644 --- a/test/versioned/redis/redis.tap.js +++ b/test/versioned/redis/redis.tap.js @@ -24,38 +24,43 @@ test('Redis instrumentation', {timeout: 20000}, function(t) { var agent var client - t.beforeEach(function(done) { - helper.flushRedisDb(DB_INDEX, (error) => { - if (error) { - return done(error) - } + t.beforeEach(function() { + return new Promise((resolve, reject) => { + helper.flushRedisDb(DB_INDEX, (error) => { + if (error) { + reject(error) + } - agent = helper.instrumentMockedAgent() + agent = helper.instrumentMockedAgent() - const redis = require('redis') - client = redis.createClient(params.redis_port, params.redis_host) - client.once('ready', () => { - client.select(DB_INDEX, function(err) { - METRIC_HOST_NAME = urltils.isLocalhost(params.redis_host) - ? agent.config.getHostnameSafe() - : params.redis_host - HOST_ID = METRIC_HOST_NAME + '/' + params.redis_port + const redis = require('redis') + client = redis.createClient(params.redis_port, params.redis_host) + client.once('ready', () => { + client.select(DB_INDEX, function(err) { + if (err) { + reject(err) + } - // need to capture attributes - agent.config.attributes.enabled = true + METRIC_HOST_NAME = urltils.isLocalhost(params.redis_host) + ? agent.config.getHostnameSafe() + : params.redis_host + HOST_ID = METRIC_HOST_NAME + '/' + params.redis_port - // Start testing! - t.notOk(agent.getTransaction(), "no transaction should be in play") - done(err) + // need to capture attributes + agent.config.attributes.enabled = true + + // Start testing! + t.notOk(agent.getTransaction(), "no transaction should be in play") + resolve() + }) }) }) }) }) - t.afterEach(function(done) { + t.afterEach(function() { client && client.end({flush: false}) agent && helper.unloadAgent(agent) - done() }) t.test('should find Redis calls in the transaction trace', function(t) { diff --git a/test/versioned/restify/restify-post-7/capture-params.tap.js b/test/versioned/restify/restify-post-7/capture-params.tap.js index dffaf54109..fca9a8092f 100644 --- a/test/versioned/restify/restify-post-7/capture-params.tap.js +++ b/test/versioned/restify/restify-post-7/capture-params.tap.js @@ -17,7 +17,7 @@ test("Restify capture params introspection", function(t) { var agent = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent({ allow_all_headers: false, attributes: { @@ -25,20 +25,17 @@ test("Restify capture params introspection", function(t) { include: ['request.parameters.*'] } }) - - done() }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) - done() }) t.test('simple case with no params', function(t) { var server = require('restify').createServer() var port = null - t.tearDown(function() { + t.teardown(function() { server.close() }) @@ -79,7 +76,7 @@ test("Restify capture params introspection", function(t) { var server = require('restify').createServer() var port = null - t.tearDown(function() { + t.teardown(function() { server.close() }) @@ -114,7 +111,7 @@ test("Restify capture params introspection", function(t) { var server = require('restify').createServer() var port = null - t.tearDown(function() { + t.teardown(function() { server.close() }) @@ -150,7 +147,7 @@ test("Restify capture params introspection", function(t) { var server = require('restify').createServer() var port = null - t.tearDown(function() { + t.teardown(function() { server.close() }) diff --git a/test/versioned/restify/restify-post-7/ignoring.tap.js b/test/versioned/restify/restify-post-7/ignoring.tap.js index 7ae8a8d981..e507a166ea 100644 --- a/test/versioned/restify/restify-post-7/ignoring.tap.js +++ b/test/versioned/restify/restify-post-7/ignoring.tap.js @@ -18,7 +18,7 @@ test("Restify router introspection", function(t) { const api = new API(agent) const server = require('restify').createServer() - t.tearDown(function() { + t.teardown(function() { server.close(function() { helper.unloadAgent(agent) }) diff --git a/test/versioned/restify/restify-post-7/restify.tap.js b/test/versioned/restify/restify-post-7/restify.tap.js index 7792b8990e..b7edb8c803 100644 --- a/test/versioned/restify/restify-post-7/restify.tap.js +++ b/test/versioned/restify/restify-post-7/restify.tap.js @@ -17,23 +17,21 @@ tap.test('Restify', (t) => { let agent = null let restify = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent() restify = require('restify') - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should not crash when handling a connection', function(t) { t.plan(7) var server = restify.createServer() - t.tearDown(() => server.close()) + t.teardown(() => server.close()) agent.on('transactionFinished', () => { var metric = agent.metrics.getMetric(METRIC) @@ -79,7 +77,7 @@ tap.test('Restify', (t) => { helper.withSSL().then(([ key, certificate, ca ]) => { var server = restify.createServer({key : key, certificate : certificate}) - t.tearDown(() => server.close()) + t.teardown(() => server.close()) server.get('/hello/:name', function sayHello(req, res) { t.ok(agent.getTransaction(), 'transaction should be available in handler') diff --git a/test/versioned/restify/restify-post-7/router.tap.js b/test/versioned/restify/restify-post-7/router.tap.js index 6ef29142e4..f4bf021e63 100644 --- a/test/versioned/restify/restify-post-7/router.tap.js +++ b/test/versioned/restify/restify-post-7/router.tap.js @@ -16,7 +16,7 @@ tap.test('Restify router', function(t) { var agent = null var server = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent({ attributes: { enabled: true, @@ -25,13 +25,14 @@ tap.test('Restify router', function(t) { }) server = require('restify').createServer() - done() }) - t.afterEach(function(done) { - server.close(function() { - helper.unloadAgent(agent) - done() + t.afterEach(function() { + return new Promise((resolve) => { + server.close(function() { + helper.unloadAgent(agent) + resolve() + }) }) }) @@ -192,5 +193,5 @@ tap.test('Restify router', function(t) { t.deepEqual(body, {status : 'ok'}, 'got expected response') }) }) - } + } }) diff --git a/test/versioned/restify/restify-post-7/rum.tap.js b/test/versioned/restify/restify-post-7/rum.tap.js index fff01f6c7b..63f9fd47f4 100644 --- a/test/versioned/restify/restify-post-7/rum.tap.js +++ b/test/versioned/restify/restify-post-7/rum.tap.js @@ -22,7 +22,7 @@ tap.test("Restify router introspection", function(t) { agent.config.browser_monitoring.browser_key = '12345' agent.config.browser_monitoring.js_agent_loader = 'function(){}' - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close(function cb_close() { helper.unloadAgent(agent) }) diff --git a/test/versioned/restify/restify-post-7/transaction-naming.tap.js b/test/versioned/restify/restify-post-7/transaction-naming.tap.js index 50da5087ef..f5822e6942 100644 --- a/test/versioned/restify/restify-post-7/transaction-naming.tap.js +++ b/test/versioned/restify/restify-post-7/transaction-naming.tap.js @@ -17,22 +17,23 @@ tap.test('Restify transaction naming', (t) => { let restifyPkg = null let server = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent() restify = require('restify') restifyPkg = require('restify/package.json') server = restify.createServer() - done() }) - t.afterEach((done) => { - helper.unloadAgent(agent) - if (server) { - server.close(done) - } else { - done() - } + t.afterEach(() => { + return new Promise((resolve) => { + helper.unloadAgent(agent) + if (server) { + server.close(resolve) + } else { + resolve() + } + }) }) t.test('transaction name with single route', (t) => { diff --git a/test/versioned/restify/restify-post-7/with-express.tap.js b/test/versioned/restify/restify-post-7/with-express.tap.js index 5729282dea..9b281a8b73 100644 --- a/test/versioned/restify/restify-post-7/with-express.tap.js +++ b/test/versioned/restify/restify-post-7/with-express.tap.js @@ -77,7 +77,7 @@ tap.test("restify shouldn't affect express query parsing middleware", function(t }) }) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close() helper.unloadAgent(agent) }) diff --git a/test/versioned/restify/restify-pre-7/capture-params.tap.js b/test/versioned/restify/restify-pre-7/capture-params.tap.js index dffaf54109..fca9a8092f 100644 --- a/test/versioned/restify/restify-pre-7/capture-params.tap.js +++ b/test/versioned/restify/restify-pre-7/capture-params.tap.js @@ -17,7 +17,7 @@ test("Restify capture params introspection", function(t) { var agent = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent({ allow_all_headers: false, attributes: { @@ -25,20 +25,17 @@ test("Restify capture params introspection", function(t) { include: ['request.parameters.*'] } }) - - done() }) - t.afterEach(function(done) { + t.afterEach(function() { helper.unloadAgent(agent) - done() }) t.test('simple case with no params', function(t) { var server = require('restify').createServer() var port = null - t.tearDown(function() { + t.teardown(function() { server.close() }) @@ -79,7 +76,7 @@ test("Restify capture params introspection", function(t) { var server = require('restify').createServer() var port = null - t.tearDown(function() { + t.teardown(function() { server.close() }) @@ -114,7 +111,7 @@ test("Restify capture params introspection", function(t) { var server = require('restify').createServer() var port = null - t.tearDown(function() { + t.teardown(function() { server.close() }) @@ -150,7 +147,7 @@ test("Restify capture params introspection", function(t) { var server = require('restify').createServer() var port = null - t.tearDown(function() { + t.teardown(function() { server.close() }) diff --git a/test/versioned/restify/restify-pre-7/ignoring.tap.js b/test/versioned/restify/restify-pre-7/ignoring.tap.js index 7ae8a8d981..e507a166ea 100644 --- a/test/versioned/restify/restify-pre-7/ignoring.tap.js +++ b/test/versioned/restify/restify-pre-7/ignoring.tap.js @@ -18,7 +18,7 @@ test("Restify router introspection", function(t) { const api = new API(agent) const server = require('restify').createServer() - t.tearDown(function() { + t.teardown(function() { server.close(function() { helper.unloadAgent(agent) }) diff --git a/test/versioned/restify/restify-pre-7/restify.tap.js b/test/versioned/restify/restify-pre-7/restify.tap.js index 88d133542f..f1be05fd21 100644 --- a/test/versioned/restify/restify-pre-7/restify.tap.js +++ b/test/versioned/restify/restify-pre-7/restify.tap.js @@ -17,23 +17,21 @@ tap.test('Restify', (t) => { let agent = null let restify = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent() restify = require('restify') - done() }) - t.afterEach((done) => { + t.afterEach(() => { helper.unloadAgent(agent) - done() }) t.test('should not crash when handling a connection', function(t) { t.plan(7) var server = restify.createServer() - t.tearDown(() => server.close()) + t.teardown(() => server.close()) server.get('/hello/:name', function sayHello(req, res) { t.ok(agent.getTransaction(), 'transaction should be available in handler') @@ -68,7 +66,7 @@ tap.test('Restify', (t) => { helper.withSSL().then(([key, certificate, ca]) => { var server = restify.createServer({key : key, certificate : certificate}) - t.tearDown(() => server.close()) + t.teardown(() => server.close()) server.get('/hello/:name', function sayHello(req, res) { t.ok(agent.getTransaction(), 'transaction should be available in handler') diff --git a/test/versioned/restify/restify-pre-7/router.tap.js b/test/versioned/restify/restify-pre-7/router.tap.js index 745502b458..ee991285ca 100644 --- a/test/versioned/restify/restify-pre-7/router.tap.js +++ b/test/versioned/restify/restify-pre-7/router.tap.js @@ -16,7 +16,7 @@ tap.test('Restify router', function(t) { var agent = null var server = null - t.beforeEach(function(done) { + t.beforeEach(function() { agent = helper.instrumentMockedAgent({ attributes: { enabled: true, @@ -25,13 +25,14 @@ tap.test('Restify router', function(t) { }) server = require('restify').createServer() - done() }) - t.afterEach(function(done) { - server.close(function() { - helper.unloadAgent(agent) - done() + t.afterEach(function() { + return new Promise((resolve) => { + server.close(function() { + helper.unloadAgent(agent) + resolve() + }) }) }) diff --git a/test/versioned/restify/restify-pre-7/rum.tap.js b/test/versioned/restify/restify-pre-7/rum.tap.js index fff01f6c7b..63f9fd47f4 100644 --- a/test/versioned/restify/restify-pre-7/rum.tap.js +++ b/test/versioned/restify/restify-pre-7/rum.tap.js @@ -22,7 +22,7 @@ tap.test("Restify router introspection", function(t) { agent.config.browser_monitoring.browser_key = '12345' agent.config.browser_monitoring.js_agent_loader = 'function(){}' - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close(function cb_close() { helper.unloadAgent(agent) }) diff --git a/test/versioned/restify/restify-pre-7/transaction-naming.tap.js b/test/versioned/restify/restify-pre-7/transaction-naming.tap.js index 420d05c00c..fdeeff52fb 100644 --- a/test/versioned/restify/restify-pre-7/transaction-naming.tap.js +++ b/test/versioned/restify/restify-pre-7/transaction-naming.tap.js @@ -17,22 +17,23 @@ tap.test('Restify transaction naming', (t) => { let restifyPkg = null let server = null - t.beforeEach((done) => { + t.beforeEach(() => { agent = helper.instrumentMockedAgent() restify = require('restify') restifyPkg = require('restify/package.json') server = restify.createServer() - done() }) - t.afterEach((done) => { - helper.unloadAgent(agent) - if (server) { - server.close(done) - } else { - done() - } + t.afterEach(() => { + return new Promise((resolve) => { + helper.unloadAgent(agent) + if (server) { + server.close(resolve) + } else { + resolve() + } + }) }) t.test('transaction name with single route', (t) => { diff --git a/test/versioned/restify/restify-pre-7/with-express.tap.js b/test/versioned/restify/restify-pre-7/with-express.tap.js index f012d88b83..762ccf6b0e 100644 --- a/test/versioned/restify/restify-pre-7/with-express.tap.js +++ b/test/versioned/restify/restify-pre-7/with-express.tap.js @@ -64,7 +64,7 @@ tap.test("restify shouldn't affect express query parsing middleware", function(t }) }) - t.tearDown(function cb_tearDown() { + t.teardown(function cb_tearDown() { server.close() helper.unloadAgent(agent) }) From 794c9d351373e73af8d0dae01c7b206eda25f0e2 Mon Sep 17 00:00:00 2001 From: Bob Evans Date: Fri, 4 Jun 2021 15:56:38 -0400 Subject: [PATCH 08/13] fixed mongodb versioned tests --- test/versioned/mongodb/db.tap.js | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/test/versioned/mongodb/db.tap.js b/test/versioned/mongodb/db.tap.js index c72272ad3c..d53368b337 100644 --- a/test/versioned/mongodb/db.tap.js +++ b/test/versioned/mongodb/db.tap.js @@ -34,7 +34,7 @@ if (semver.satisfies(mongoPackage.version, '<3')) { helper.runInTransaction(agent, function inTransaction(transaction) { db.open(function onOpen(err, _db) { var segment = agent.tracer.getSegment() - t.error(err) + t.error(err, 'db.open should not error') t.equal(db, _db, 'should pass through the arguments correctly') t.equal(agent.getTransaction(), transaction, 'should not lose tx state') t.equal(segment.name, 'Callback: onOpen', 'should create segments') @@ -44,7 +44,7 @@ if (semver.satisfies(mongoPackage.version, '<3')) { parent.name, 'Datastore/operation/MongoDB/open', 'should name segment correctly' ) - t.notEqual(parent.children.indexOf(segment), -1, 'should have callback as child') + t.not(parent.children.indexOf(segment), -1, 'should have callback as child') db.close() t.end() }) @@ -292,15 +292,13 @@ function dbTest(name, collections, run) { t.test('remote connection', function(t) { t.autoend() - t.beforeEach(function() { + t.beforeEach(async function() { MONGO_HOST = common.getHostName(agent) MONGO_PORT = common.getPort() - return common.connect(mongodb) - .then((res) => { - client = res.client - db = res.db - }) + const res = await common.connect(mongodb) + client = res.client + db = res.db }) t.afterEach(function() { @@ -364,11 +362,7 @@ function dbTest(name, collections, run) { function mongoTest(name, collections, run) { tap.test(name, function testWrap(t) { const mongodb = require('mongodb') - collectionCommon.dropTestCollections(mongodb, collections, (err) => { - if (!t.error(err)) { - return t.end() - } - + collectionCommon.dropTestCollections(mongodb, collections).then(() => { run(t, helper.loadTestAgent(t)) }) }) From 4be5fa1399a0ddab5c7ae120627f706464dcefca Mon Sep 17 00:00:00 2001 From: Bob Evans Date: Mon, 7 Jun 2021 10:33:48 -0400 Subject: [PATCH 09/13] replace contains with match in hapi-pre-17 tests --- test/versioned/hapi/hapi-pre-17/render-v6.tap.js | 2 +- test/versioned/hapi/hapi-pre-17/render-v7.tap.js | 2 +- test/versioned/hapi/hapi-pre-17/render.tap.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/versioned/hapi/hapi-pre-17/render-v6.tap.js b/test/versioned/hapi/hapi-pre-17/render-v6.tap.js index 5e88b5c1a3..62ba27f79e 100644 --- a/test/versioned/hapi/hapi-pre-17/render-v6.tap.js +++ b/test/versioned/hapi/hapi-pre-17/render-v6.tap.js @@ -201,7 +201,7 @@ test('agent instrumentation of Hapi', function(t) { var first = errors[0] t.ok(first, 'have the first error') - t.contains(first[2], 'ohno', 'got the expected error') + t.match(first[2], 'ohno', 'got the expected error') t.end() }) diff --git a/test/versioned/hapi/hapi-pre-17/render-v7.tap.js b/test/versioned/hapi/hapi-pre-17/render-v7.tap.js index 42b85c6dbe..b650a7c5a4 100644 --- a/test/versioned/hapi/hapi-pre-17/render-v7.tap.js +++ b/test/versioned/hapi/hapi-pre-17/render-v7.tap.js @@ -195,7 +195,7 @@ tap.test('agent instrumentation of Hapi', function(t) { var first = errors[0] t.ok(first, 'have the first error') - t.contains(first[2], 'ohno', 'got the expected error') + t.match(first[2], 'ohno', 'got the expected error') t.end() }) diff --git a/test/versioned/hapi/hapi-pre-17/render.tap.js b/test/versioned/hapi/hapi-pre-17/render.tap.js index 11820454a9..d5f9a4b140 100644 --- a/test/versioned/hapi/hapi-pre-17/render.tap.js +++ b/test/versioned/hapi/hapi-pre-17/render.tap.js @@ -201,7 +201,7 @@ tap.test('agent instrumentation of Hapi', function(t) { var first = errors[0] t.ok(first, 'have the first error') - t.contains(first[2], 'ohno', 'got the expected error') + t.match(first[2], 'ohno', 'got the expected error') t.end() }) From 8fa9854d64a1c1830886f0cbc2ca0d33b10c1a6d Mon Sep 17 00:00:00 2001 From: Bob Evans Date: Tue, 20 Jul 2021 17:02:57 -0400 Subject: [PATCH 10/13] bumped deps --- package-lock.json | 41 ++++++++++++++++++----------------------- package.json | 10 +++++----- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4fc76108fd..f5ed4a5851 100644 --- a/package-lock.json +++ b/package-lock.json @@ -461,25 +461,22 @@ } }, "@newrelic/aws-sdk": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@newrelic/aws-sdk/-/aws-sdk-3.1.0.tgz", - "integrity": "sha512-SBFqCz1Hhn2HQvlFCEm2VwfHCGpemeokJ+NH7XphlfQ211OVVANQf49DOQCCS0uhnLHGbKMLmir8Layx57y48A==" + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@newrelic/aws-sdk/-/aws-sdk-4.0.1.tgz", + "integrity": "sha512-6pjPHKODTMItaO6zHDSR3HH7ohvUP9zzQf2pKMKdU4lB/1HV2+Xf6r92X96zPmGQsAnCP9xhgbseUklHD00a1Q==" }, "@newrelic/koa": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@newrelic/koa/-/koa-5.0.0.tgz", - "integrity": "sha512-4jzRXnUe38gQkZI8K4tWQ6CNdCNTi5uKILf1dTkyT6LpGxzDSLPwVyJ6xtMSMzr8SjIPG7lyNoWe42q8wFA7jg==", - "requires": { - "methods": "^1.1.2" - } + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@newrelic/koa/-/koa-6.0.1.tgz", + "integrity": "sha512-LrM0wLBcdngkL6gfAyqlBciqncZJ/Z2DhHCvKQbYSqwG0UxUZ5EZyYqkmU28UIFAdC6ag/6QDEFwYg3PXwJbzQ==" }, "@newrelic/native-metrics": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@newrelic/native-metrics/-/native-metrics-6.0.0.tgz", - "integrity": "sha512-EUdlsv25dEMT+8SOV02Xfk2E3UTo2fH33lVmnv/CSllH6+ljJDAfG0Ib5zY92Qmaj+oiThbfRpSYOlUfH+Uuiw==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@newrelic/native-metrics/-/native-metrics-7.0.1.tgz", + "integrity": "sha512-bsobT/Fb1Y5h07BGpQM/8S8pPrX+fuudEd0C7gEn1y2Bst0Su1O7Lp7eSBjO+N5jVITJhKX+cKCv4hWFu0D8qA==", "optional": true, "requires": { - "nan": "^2.14.1", + "nan": "^2.14.2", "semver": "^5.5.1" }, "dependencies": { @@ -503,17 +500,14 @@ } }, "@newrelic/superagent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@newrelic/superagent/-/superagent-4.0.0.tgz", - "integrity": "sha512-n4iNrsV0908yHNZPNof7rm/mffclHaIxprCCWk15b4IRJik2VrtuIrK3mboUgNdv5pX4P7EZytY/D6kJgFkDGw==", - "requires": { - "methods": "^1.1.2" - } + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@newrelic/superagent/-/superagent-5.0.1.tgz", + "integrity": "sha512-Efn/G0OohcjDkNEgH/eqiie8boWYMFVT++zxHquIj7I8FdTd2ZoKzcxS2lbkbEAKKXO54o8+cShJTwpptkAdGg==" }, "@newrelic/test-utilities": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@newrelic/test-utilities/-/test-utilities-5.1.0.tgz", - "integrity": "sha512-Z4W27G/ivPIVKA42liIQhnicuqA2Tqw62gkE2/tb92yZpZlyVLswqOovfM7/3vG3GuXJJ/mnceVMJYIC1MzRmw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@newrelic/test-utilities/-/test-utilities-6.0.0.tgz", + "integrity": "sha512-6j3Zj6Iw92G6+vIEXjJPp3s919U+1WJNCx+LcP/FELwbJ6N9WE9BmZEHL50O0FGZnosRk+uozvPwtxG7uHulYg==", "dev": true, "requires": { "async": "^2.6.0", @@ -4648,7 +4642,8 @@ "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true }, "micromatch": { "version": "4.0.4", diff --git a/package.json b/package.json index 71258dcfe5..064aa74158 100644 --- a/package.json +++ b/package.json @@ -145,9 +145,9 @@ "dependencies": { "@grpc/grpc-js": "^1.2.11", "@grpc/proto-loader": "^0.5.6", - "@newrelic/aws-sdk": "^3.1.0", - "@newrelic/koa": "^5.0.0", - "@newrelic/superagent": "^4.0.0", + "@newrelic/aws-sdk": "^4.0.1", + "@newrelic/koa": "^6.0.1", + "@newrelic/superagent": "^5.0.1", "@tyriar/fibonacci-heap": "^2.0.7", "async": "^3.2.0", "concat-stream": "^2.0.0", @@ -157,11 +157,11 @@ "semver": "^5.3.0" }, "optionalDependencies": { - "@newrelic/native-metrics": "^6.0.0" + "@newrelic/native-metrics": "^7.0.1" }, "devDependencies": { "@newrelic/proxy": "^2.0.0", - "@newrelic/test-utilities": "^5.1.0", + "@newrelic/test-utilities": "^6.0.0", "@octokit/rest": "^18.0.15", "JSV": "~4.0.2", "architect": "*", From 82f2267880145105023df449623433043cdc678b Mon Sep 17 00:00:00 2001 From: Bob Evans Date: Wed, 21 Jul 2021 10:18:25 -0400 Subject: [PATCH 11/13] fixed hapi-pre-17 versioned tests by passing resolve promise as cb to server.stop --- test/versioned/hapi/hapi-pre-17/errors.tap.js | 2 +- test/versioned/hapi/hapi-pre-17/ext-v16.tap.js | 2 +- test/versioned/hapi/hapi-pre-17/plugins-v16.tap.js | 2 +- test/versioned/hapi/hapi-pre-17/render-v6.tap.js | 2 +- test/versioned/hapi/hapi-pre-17/render-v7.tap.js | 2 +- test/versioned/hapi/hapi-pre-17/render-v9.tap.js | 2 +- test/versioned/hapi/hapi-pre-17/render.tap.js | 2 +- test/versioned/hapi/hapi-pre-17/router-v16.tap.js | 2 +- test/versioned/hapi/hapi-pre-17/router.tap.js | 2 +- test/versioned/hapi/hapi-pre-17/segments-v16.tap.js | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/versioned/hapi/hapi-pre-17/errors.tap.js b/test/versioned/hapi/hapi-pre-17/errors.tap.js index bcce1523a5..c6b873fdb0 100644 --- a/test/versioned/hapi/hapi-pre-17/errors.tap.js +++ b/test/versioned/hapi/hapi-pre-17/errors.tap.js @@ -25,7 +25,7 @@ tap.test('Hapi v16 error handling', function(t) { t.afterEach(function() { helper.unloadAgent(agent) - return server.stop() + return new Promise((resolve) => server.stop(resolve)) }) t.test('does not report error when reply is called with a string', function(t) { diff --git a/test/versioned/hapi/hapi-pre-17/ext-v16.tap.js b/test/versioned/hapi/hapi-pre-17/ext-v16.tap.js index 6091343357..5b6eed245a 100644 --- a/test/versioned/hapi/hapi-pre-17/ext-v16.tap.js +++ b/test/versioned/hapi/hapi-pre-17/ext-v16.tap.js @@ -38,7 +38,7 @@ tap.test('Hapi.ext', function(t) { t.afterEach(function() { helper.unloadAgent(agent) - return server.stop() + return new Promise((resolve) => server.stop(resolve)) }) t.test('maintains transaction state', function(t) { diff --git a/test/versioned/hapi/hapi-pre-17/plugins-v16.tap.js b/test/versioned/hapi/hapi-pre-17/plugins-v16.tap.js index ea41d616ad..a4ffa9eade 100644 --- a/test/versioned/hapi/hapi-pre-17/plugins-v16.tap.js +++ b/test/versioned/hapi/hapi-pre-17/plugins-v16.tap.js @@ -38,7 +38,7 @@ tap.test('Hapi Plugins', function(t) { t.afterEach(function() { helper.unloadAgent(agent) - return server.stop() + return new Promise((resolve) => server.stop(resolve)) }) t.test('maintains transaction state', function(t) { diff --git a/test/versioned/hapi/hapi-pre-17/render-v6.tap.js b/test/versioned/hapi/hapi-pre-17/render-v6.tap.js index 62ba27f79e..abffbedcfd 100644 --- a/test/versioned/hapi/hapi-pre-17/render-v6.tap.js +++ b/test/versioned/hapi/hapi-pre-17/render-v6.tap.js @@ -27,7 +27,7 @@ test('agent instrumentation of Hapi', function(t) { t.afterEach(function() { helper.unloadAgent(agent) - return server.stop() + return new Promise((resolve) => server.stop(resolve)) }) t.test('for a normal request', {timeout: 5000}, function(t) { diff --git a/test/versioned/hapi/hapi-pre-17/render-v7.tap.js b/test/versioned/hapi/hapi-pre-17/render-v7.tap.js index b650a7c5a4..2f1c2b347e 100644 --- a/test/versioned/hapi/hapi-pre-17/render-v7.tap.js +++ b/test/versioned/hapi/hapi-pre-17/render-v7.tap.js @@ -27,7 +27,7 @@ tap.test('agent instrumentation of Hapi', function(t) { t.afterEach(function() { helper.unloadAgent(agent) - return server.stop() + return new Promise((resolve) => server.stop(resolve)) }) t.test('for a normal request', {timeout: 5000}, function(t) { diff --git a/test/versioned/hapi/hapi-pre-17/render-v9.tap.js b/test/versioned/hapi/hapi-pre-17/render-v9.tap.js index 4cad385a44..5869ed9ded 100644 --- a/test/versioned/hapi/hapi-pre-17/render-v9.tap.js +++ b/test/versioned/hapi/hapi-pre-17/render-v9.tap.js @@ -28,7 +28,7 @@ tap.test('agent instrumentation of Hapi', function(t) { t.afterEach(function() { helper.unloadAgent(agent) - return server.stop() + return new Promise((resolve) => server.stop(resolve)) }) t.test('for a normal request', {timeout: 5000}, function(t) { diff --git a/test/versioned/hapi/hapi-pre-17/render.tap.js b/test/versioned/hapi/hapi-pre-17/render.tap.js index d5f9a4b140..23477d338b 100644 --- a/test/versioned/hapi/hapi-pre-17/render.tap.js +++ b/test/versioned/hapi/hapi-pre-17/render.tap.js @@ -27,7 +27,7 @@ tap.test('agent instrumentation of Hapi', function(t) { t.afterEach(function() { helper.unloadAgent(agent) - return server.stop() + return new Promise((resolve) => server.stop(resolve)) }) t.test('for a normal request', {timeout: 5000}, function(t) { diff --git a/test/versioned/hapi/hapi-pre-17/router-v16.tap.js b/test/versioned/hapi/hapi-pre-17/router-v16.tap.js index 6473abadd1..fc8be1f309 100644 --- a/test/versioned/hapi/hapi-pre-17/router-v16.tap.js +++ b/test/versioned/hapi/hapi-pre-17/router-v16.tap.js @@ -30,7 +30,7 @@ tap.test('Hapi router introspection', function(t) { t.afterEach(function() { helper.unloadAgent(agent) - return server.stop() + return new Promise((resolve) => server.stop(resolve)) }) t.test('using route handler - simple case', function(t) { diff --git a/test/versioned/hapi/hapi-pre-17/router.tap.js b/test/versioned/hapi/hapi-pre-17/router.tap.js index c17083054a..71fae07989 100644 --- a/test/versioned/hapi/hapi-pre-17/router.tap.js +++ b/test/versioned/hapi/hapi-pre-17/router.tap.js @@ -30,7 +30,7 @@ tap.test('Hapi router introspection', function(t) { t.afterEach(function() { helper.unloadAgent(agent) - return server.stop() + return new Promise((resolve) => server.stop(resolve)) }) t.test('simple case using server.route', function(t) { diff --git a/test/versioned/hapi/hapi-pre-17/segments-v16.tap.js b/test/versioned/hapi/hapi-pre-17/segments-v16.tap.js index bdaff1e21f..1605875c3c 100644 --- a/test/versioned/hapi/hapi-pre-17/segments-v16.tap.js +++ b/test/versioned/hapi/hapi-pre-17/segments-v16.tap.js @@ -28,7 +28,7 @@ tap.test('Hapi v16 segments', function(t) { t.afterEach(function() { helper.unloadAgent(agent) - return server.stop() + return new Promise((resolve) => server.stop(resolve)) }) t.test('route handler is recorded as middleware', function(t) { From f5317270db71e18d8bdc64feb29c9987143143f6 Mon Sep 17 00:00:00 2001 From: Bob Evans Date: Wed, 21 Jul 2021 18:31:28 -0400 Subject: [PATCH 12/13] addressed minor feedback from PR review --- test/integration/instrumentation/memcached.tap.js | 2 +- test/unit/instrumentation/http/http.test.js | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/test/integration/instrumentation/memcached.tap.js b/test/integration/instrumentation/memcached.tap.js index a6a48260bc..a566e8e471 100644 --- a/test/integration/instrumentation/memcached.tap.js +++ b/test/integration/instrumentation/memcached.tap.js @@ -36,7 +36,7 @@ test('memcached instrumentation', {timeout : 5000}, function(t) { Memcached = require('memcached') memcached = new Memcached(params.memcached_host + ':' + params.memcached_port) - var hostName = getMetricHostName(agent, params.memcached_host) + const hostName = getMetricHostName(agent, params.memcached_host) HOST_ID = hostName + '/' + params.memcached_port }) diff --git a/test/unit/instrumentation/http/http.test.js b/test/unit/instrumentation/http/http.test.js index 8946ebc4ed..ea809ec375 100644 --- a/test/unit/instrumentation/http/http.test.js +++ b/test/unit/instrumentation/http/http.test.js @@ -283,8 +283,6 @@ test('built-in http module instrumentation', (t) => { const segment = transaction.baseSegment const spanAttributes = segment.attributes.get(DESTINATIONS.SPAN_EVENT) - // TODO: these attrs aren't getting filtered - // not familiar with code so trying to trace where this is supposed to be removed t.notOk(attributes['request.headers.x-filtered-out']) t.notOk(attributes['request.headers.xFilteredOut']) t.match(attributes, { From b85aa3d34bce8a11279d5ae30bd540b32f406d50 Mon Sep 17 00:00:00 2001 From: Bob Evans Date: Wed, 21 Jul 2021 18:35:10 -0400 Subject: [PATCH 13/13] updated smoke test to be tap 15 compliant --- test/smoke/agent/lasp-send-trace.tap.js | 4 ++-- test/smoke/index/index-bad-version.tap.js | 3 +-- test/smoke/index/index.tap.js | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/test/smoke/agent/lasp-send-trace.tap.js b/test/smoke/agent/lasp-send-trace.tap.js index 8bf1e6c4ad..05dddeeef8 100644 --- a/test/smoke/agent/lasp-send-trace.tap.js +++ b/test/smoke/agent/lasp-send-trace.tap.js @@ -53,7 +53,7 @@ tap.test('LASP-enabled agent', (t) => { api.addCustomAttribute('foo', 'bar') api.addCustomAttribute('fizz', 'buzz') var attributes = transaction.trace.custom.attributes - t.deepEqual( + t.same( Object.keys(attributes), ['foo', 'fizz'], 'transaction trace has custom attributes' @@ -88,7 +88,7 @@ tap.test('LASP-enabled agent', (t) => { api.addCustomAttribute('foo', 'bar') api.addCustomAttribute('fizz', 'buzz') var attributes = transaction.trace.custom.attributes - t.deepEqual( + t.same( Object.keys(attributes), ['foo', 'fizz'], 'transaction trace has custom attributes' diff --git a/test/smoke/index/index-bad-version.tap.js b/test/smoke/index/index-bad-version.tap.js index 7ae99c2db7..c4bfd152bb 100644 --- a/test/smoke/index/index-bad-version.tap.js +++ b/test/smoke/index/index-bad-version.tap.js @@ -17,12 +17,11 @@ tap.test('load agent with bad versions should load stub agent', (t) => { process.env.NEW_RELIC_HOST = 'staging-collector.newrelic.com' process.env.NEW_RELIC_LICENSE_KEY = license - t.afterEach((done) => { + t.afterEach(() => { // must delete both of these to force a reload // of the index.js file delete require.cache.__NR_cache delete require.cache[require.resolve('../../../index.js')] - done() }) VERSIONS.forEach((version) => { diff --git a/test/smoke/index/index.tap.js b/test/smoke/index/index.tap.js index e2bdaa0ac6..0609e3f8a4 100644 --- a/test/smoke/index/index.tap.js +++ b/test/smoke/index/index.tap.js @@ -34,8 +34,8 @@ test('loading the application via index.js', {timeout: 15000}, (t) => { function shutdown() { t.equal(agent._state, 'started', "agent didn't error connecting to staging") - t.deepEquals(agent.config.applications(), ['My Application'], "app name is valid") - t.equals(agent.config.agent_enabled, true, "the agent is still enabled") + t.same(agent.config.applications(), ['My Application'], "app name is valid") + t.equal(agent.config.agent_enabled, true, "the agent is still enabled") agent.stop(function cb_stop(err) { t.notOk(err, 'should not error when stopping')