From f9552078235307f73d2dd9aa8806ff7a93e3094f Mon Sep 17 00:00:00 2001 From: Guillaume ROUCHON Date: Mon, 24 Mar 2025 08:57:19 +0100 Subject: [PATCH 1/3] v6: add node20 --- .github/workflows/ci.yml | 8 +- CHANGELOG.md | 4 + package-lock.json | 285 +++++++++++------------- package.json | 4 +- tasks/ReplaceTokensV6/CHANGELOG.md | 3 + tasks/ReplaceTokensV6/package-lock.json | 179 ++++++--------- tasks/ReplaceTokensV6/package.json | 4 +- tasks/ReplaceTokensV6/task.json | 6 +- vss-extension.json | 2 +- 9 files changed, 221 insertions(+), 274 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57a88f0..a5ea9b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,10 +25,10 @@ jobs: with: python-version: '3.11' - - name: Setup nodejs 16.x + - name: Setup nodejs 20.x uses: actions/setup-node@v4 with: - node-version: 16.x + node-version: 20.x - name: Install dependencies run: | @@ -93,10 +93,10 @@ jobs: cp $env:RUNNER_TEMP/node6/node.exe $env:USERPROFILE/azure-pipelines-task-lib/_download/node6 echo '' > $env:USERPROFILE/azure-pipelines-task-lib/_download/node6.completed - - name: Setup nodejs 16.x + - name: Setup nodejs 20.x uses: actions/setup-node@v4 with: - node-version: 16.x + node-version: 20.x - name: Install dependencies run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 2165c03..bbabc22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Changelog +## 5.2.0 +Task 6.2.0 +- Add Node 20 support ([#74](https://github.com/qetza/replacetokens-task/issues/74)). + ## 5.1.0 Task 6.1.0 - Add _useAdditionalVariablesOnly_ parameter ([#29](https://github.com/qetza/replacetokens-task/issues/60)). diff --git a/package-lock.json b/package-lock.json index e234388..8729f13 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,8 +15,8 @@ "prettier": "^3.2.5", "semver": "^7.6.0", "shelljs": "^0.8.5", - "tfx-cli": "^0.16.0", - "typescript": "^4.8.4" + "tfx-cli": "^0.21.0", + "typescript": "^5.1.6" } }, "node_modules/@babel/code-frame": { @@ -92,10 +92,11 @@ } }, "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -302,12 +303,13 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -567,8 +569,9 @@ "node_modules/cross-spawn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", "dev": true, + "license": "MIT", "dependencies": { "lru-cache": "^4.0.1", "shebang-command": "^1.2.0", @@ -601,12 +604,13 @@ } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, + "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -617,12 +621,6 @@ } } }, - "node_modules/debug/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/decamelize": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-5.0.0.tgz", @@ -679,10 +677,11 @@ } }, "node_modules/diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } @@ -780,8 +779,9 @@ "node_modules/execa": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/execa/-/execa-0.8.0.tgz", - "integrity": "sha1-2NdrvBtVIX7RkP1t1J08d07PyNo=", + "integrity": "sha512-zDWS+Rb1E8BlqqhALSt9kUhss8Qq4nN3iof3gsOdyINksElaPyNBtKUMTR62qhvgVWR0CqCX7sdnKe4MnUbFEA==", "dev": true, + "license": "MIT", "dependencies": { "cross-spawn": "^5.0.1", "get-stream": "^3.0.0", @@ -805,10 +805,11 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -1293,6 +1294,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -1708,31 +1710,32 @@ } }, "node_modules/mocha": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.3.0.tgz", - "integrity": "sha512-uF2XJs+7xSLsrmIvn37i/wnc91nw7XjOQB8ccyx5aEgdnohr7n+rEiZP23WkCYHjilR6+EboEnbq/ZQDz4LSbg==", - "dev": true, - "dependencies": { - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.4", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "8.1.0", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "5.0.1", - "ms": "2.1.3", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "workerpool": "6.2.1", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", + "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^8.1.0", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9", + "yargs-unparser": "^2.0.0" }, "bin": { "_mocha": "bin/_mocha", @@ -1792,10 +1795,11 @@ } }, "node_modules/mocha/node_modules/minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -1818,15 +1822,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/mocha/node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -2150,6 +2145,7 @@ "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "^5.1.0" } @@ -2343,10 +2339,11 @@ "dev": true }, "node_modules/serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "randombytes": "^2.1.0" } @@ -2596,10 +2593,11 @@ } }, "node_modules/tfx-cli": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/tfx-cli/-/tfx-cli-0.16.0.tgz", - "integrity": "sha512-kWRIvZiHWqpaCnHmXmJ/+Bzegiaf+q1+lkG0ht2+REW7qmQDaRMgeMeCiQCk0UDudQN1cPhPJSalzy3BwwxGuA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/tfx-cli/-/tfx-cli-0.21.0.tgz", + "integrity": "sha512-zyrRi7lwBVAlEHPNJOzP61pE0Y2N9T/WQFYkkNY0+OEP5uTX8/bOP9Mxv/TtR99fdJmjv5L/b3lVuAXn7h8fBg==", "dev": true, + "license": "MIT", "dependencies": { "app-root-path": "1.0.0", "archiver": "2.0.3", @@ -2682,6 +2680,7 @@ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -2757,16 +2756,17 @@ } }, "node_modules/typescript": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", - "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/unbox-primitive": { @@ -2911,10 +2911,11 @@ } }, "node_modules/workerpool": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", - "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", - "dev": true + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true, + "license": "Apache-2.0" }, "node_modules/wrap-ansi": { "version": "7.0.0", @@ -3168,9 +3169,9 @@ "dev": true }, "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", "dev": true }, "ansi-regex": { @@ -3327,12 +3328,12 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browser-stdout": { @@ -3530,7 +3531,7 @@ "cross-spawn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", "dev": true, "requires": { "lru-cache": "^4.0.1", @@ -3555,20 +3556,12 @@ } }, "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "requires": { - "ms": "2.1.2" - }, - "dependencies": { - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } + "ms": "^2.1.3" } }, "decamelize": { @@ -3611,9 +3604,9 @@ } }, "diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", "dev": true }, "emoji-regex": { @@ -3691,7 +3684,7 @@ "execa": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/execa/-/execa-0.8.0.tgz", - "integrity": "sha1-2NdrvBtVIX7RkP1t1J08d07PyNo=", + "integrity": "sha512-zDWS+Rb1E8BlqqhALSt9kUhss8Qq4nN3iof3gsOdyINksElaPyNBtKUMTR62qhvgVWR0CqCX7sdnKe4MnUbFEA==", "dev": true, "requires": { "cross-spawn": "^5.0.1", @@ -3710,9 +3703,9 @@ "dev": true }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "requires": { "to-regex-range": "^5.0.1" @@ -4359,31 +4352,31 @@ "dev": true }, "mocha": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.3.0.tgz", - "integrity": "sha512-uF2XJs+7xSLsrmIvn37i/wnc91nw7XjOQB8ccyx5aEgdnohr7n+rEiZP23WkCYHjilR6+EboEnbq/ZQDz4LSbg==", + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", + "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", "dev": true, "requires": { - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.4", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "8.1.0", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "5.0.1", - "ms": "2.1.3", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "workerpool": "6.2.1", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^8.1.0", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9", + "yargs-unparser": "^2.0.0" }, "dependencies": { "brace-expansion": { @@ -4421,9 +4414,9 @@ "dev": true }, "minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -4437,12 +4430,6 @@ "requires": { "has-flag": "^4.0.0" } - }, - "yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true } } }, @@ -4820,9 +4807,9 @@ } }, "serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, "requires": { "randombytes": "^2.1.0" @@ -5016,9 +5003,9 @@ } }, "tfx-cli": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/tfx-cli/-/tfx-cli-0.16.0.tgz", - "integrity": "sha512-kWRIvZiHWqpaCnHmXmJ/+Bzegiaf+q1+lkG0ht2+REW7qmQDaRMgeMeCiQCk0UDudQN1cPhPJSalzy3BwwxGuA==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/tfx-cli/-/tfx-cli-0.21.0.tgz", + "integrity": "sha512-zyrRi7lwBVAlEHPNJOzP61pE0Y2N9T/WQFYkkNY0+OEP5uTX8/bOP9Mxv/TtR99fdJmjv5L/b3lVuAXn7h8fBg==", "dev": true, "requires": { "app-root-path": "1.0.0", @@ -5142,9 +5129,9 @@ } }, "typescript": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", - "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true }, "unbox-primitive": { @@ -5263,9 +5250,9 @@ } }, "workerpool": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", - "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", "dev": true }, "wrap-ansi": { diff --git a/package.json b/package.json index f87a569..615932d 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "prettier": "^3.2.5", "semver": "^7.6.0", "shelljs": "^0.8.5", - "tfx-cli": "^0.16.0", - "typescript": "^4.8.4" + "tfx-cli": "^0.21.0", + "typescript": "^5.1.6" } } diff --git a/tasks/ReplaceTokensV6/CHANGELOG.md b/tasks/ReplaceTokensV6/CHANGELOG.md index 7c828de..c3503ab 100644 --- a/tasks/ReplaceTokensV6/CHANGELOG.md +++ b/tasks/ReplaceTokensV6/CHANGELOG.md @@ -1,4 +1,7 @@ # Changelog +## 6.2.0 +- Add Node 20 support ([#74](https://github.com/qetza/replacetokens-task/issues/74)). + ## 6.1.0 - Add _useAdditionalVariablesOnly_ parameter ([#29](https://github.com/qetza/replacetokens-task/issues/60)). diff --git a/tasks/ReplaceTokensV6/package-lock.json b/tasks/ReplaceTokensV6/package-lock.json index 7750fb2..e8d718e 100644 --- a/tasks/ReplaceTokensV6/package-lock.json +++ b/tasks/ReplaceTokensV6/package-lock.json @@ -11,7 +11,7 @@ "@opentelemetry/semantic-conventions": "^1.22.0", "@qetza/replacetokens": "^1.6.0", "axios": "^1.6.7", - "azure-pipelines-task-lib": "^4.1.0", + "azure-pipelines-task-lib": "^4.13.0", "js-yaml": "^4.1.0", "replacetokens-task": "file:../.." }, @@ -19,7 +19,7 @@ "@types/chai": "^4.3.12", "@types/js-yaml": "^4.0.9", "@types/mocha": "^10.0.6", - "@types/node": "^16.11.39", + "@types/node": "^20.3.1", "chai": "^4.4.1" } }, @@ -33,8 +33,8 @@ "prettier": "^3.2.5", "semver": "^7.6.0", "shelljs": "^0.8.5", - "tfx-cli": "^0.16.0", - "typescript": "^4.8.4" + "tfx-cli": "^0.21.0", + "typescript": "^5.1.6" } }, "node_modules/@nodelib/fs.scandir": { @@ -168,10 +168,11 @@ "dev": true }, "node_modules/@types/node": { - "version": "16.11.39", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.39.tgz", - "integrity": "sha512-K0MsdV42vPwm9L6UwhIxMAOmcvH/1OoVkZyCgEtVu4Wx7sElGloy/W7kMBNe/oJ7V/jW9BVt1F6RahH6e7tPXw==", - "dev": true + "version": "20.3.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.1.tgz", + "integrity": "sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg==", + "dev": true, + "license": "MIT" }, "node_modules/adm-zip": { "version": "0.5.10", @@ -234,22 +235,23 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", - "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", + "version": "1.8.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz", + "integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==", + "license": "MIT", "dependencies": { - "follow-redirects": "^1.15.4", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } }, "node_modules/azure-pipelines-task-lib": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-4.10.0.tgz", - "integrity": "sha512-/j5nwVEPYx/WV/5H66BuMK3ubrKYFgbFc0yPmEwfXvDwNbgXeIHtcXXZGHiCVq2q+JmHcFYav9sfOrCq2O2Bdg==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-4.13.0.tgz", + "integrity": "sha512-KVguui31If98vgokNepHUxE3/D8UFB4FHV1U6XxjGOkgxxwKxbupC3knVnEiZA/hNl7X+vmj9KrYOx79iwmezQ==", + "license": "MIT", "dependencies": { "adm-zip": "^0.5.10", - "deasync": "^0.1.28", "minimatch": "3.0.5", "nodejs-file-downloader": "^4.11.1", "q": "^1.5.1", @@ -263,14 +265,6 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "node_modules/bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "dependencies": { - "file-uri-to-path": "1.0.0" - } - }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -281,11 +275,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -366,19 +361,6 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, - "node_modules/deasync": { - "version": "0.1.29", - "resolved": "https://registry.npmjs.org/deasync/-/deasync-0.1.29.tgz", - "integrity": "sha512-EBtfUhVX23CE9GR6m+F8WPeImEE4hR/FW9RkK0PMl9V1t283s0elqsTD8EZjaKX28SY1BW2rYfCgNsAYdpamUw==", - "hasInstallScript": true, - "dependencies": { - "bindings": "^1.5.0", - "node-addon-api": "^1.7.1" - }, - "engines": { - "node": ">=0.11.0" - } - }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -456,15 +438,11 @@ "reusify": "^1.0.4" } }, - "node_modules/file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" - }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -473,15 +451,16 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", "funding": [ { "type": "individual", "url": "https://github.com/sponsors/RubenVerborgh" } ], + "license": "MIT", "engines": { "node": ">=4.0" }, @@ -673,6 +652,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -714,11 +694,12 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -755,11 +736,6 @@ "node": "*" } }, - "node_modules/node-addon-api": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.7.2.tgz", - "integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==" - }, "node_modules/nodejs-file-downloader": { "version": "4.12.1", "resolved": "https://registry.npmjs.org/nodejs-file-downloader/-/nodejs-file-downloader-4.12.1.tgz", @@ -991,6 +967,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -1176,9 +1153,9 @@ "dev": true }, "@types/node": { - "version": "16.11.39", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.39.tgz", - "integrity": "sha512-K0MsdV42vPwm9L6UwhIxMAOmcvH/1OoVkZyCgEtVu4Wx7sElGloy/W7kMBNe/oJ7V/jW9BVt1F6RahH6e7tPXw==", + "version": "20.3.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.1.tgz", + "integrity": "sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg==", "dev": true }, "adm-zip": { @@ -1224,22 +1201,21 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "axios": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", - "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", + "version": "1.8.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz", + "integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==", "requires": { - "follow-redirects": "^1.15.4", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } }, "azure-pipelines-task-lib": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-4.10.0.tgz", - "integrity": "sha512-/j5nwVEPYx/WV/5H66BuMK3ubrKYFgbFc0yPmEwfXvDwNbgXeIHtcXXZGHiCVq2q+JmHcFYav9sfOrCq2O2Bdg==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-4.13.0.tgz", + "integrity": "sha512-KVguui31If98vgokNepHUxE3/D8UFB4FHV1U6XxjGOkgxxwKxbupC3knVnEiZA/hNl7X+vmj9KrYOx79iwmezQ==", "requires": { "adm-zip": "^0.5.10", - "deasync": "^0.1.28", "minimatch": "3.0.5", "nodejs-file-downloader": "^4.11.1", "q": "^1.5.1", @@ -1253,14 +1229,6 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "requires": { - "file-uri-to-path": "1.0.0" - } - }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -1271,11 +1239,11 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "chai": { @@ -1338,15 +1306,6 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, - "deasync": { - "version": "0.1.29", - "resolved": "https://registry.npmjs.org/deasync/-/deasync-0.1.29.tgz", - "integrity": "sha512-EBtfUhVX23CE9GR6m+F8WPeImEE4hR/FW9RkK0PMl9V1t283s0elqsTD8EZjaKX28SY1BW2rYfCgNsAYdpamUw==", - "requires": { - "bindings": "^1.5.0", - "node-addon-api": "^1.7.1" - } - }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -1406,23 +1365,18 @@ "reusify": "^1.0.4" } }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" - }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "requires": { "to-regex-range": "^5.0.1" } }, "follow-redirects": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==" + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==" }, "form-data": { "version": "4.0.0", @@ -1589,11 +1543,11 @@ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" }, "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "requires": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" } }, @@ -1618,11 +1572,6 @@ "brace-expansion": "^1.1.7" } }, - "node-addon-api": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.7.2.tgz", - "integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==" - }, "nodejs-file-downloader": { "version": "4.12.1", "resolved": "https://registry.npmjs.org/nodejs-file-downloader/-/nodejs-file-downloader-4.12.1.tgz", @@ -1695,8 +1644,8 @@ "prettier": "^3.2.5", "semver": "^7.6.0", "shelljs": "^0.8.5", - "tfx-cli": "^0.16.0", - "typescript": "^4.8.4" + "tfx-cli": "^0.21.0", + "typescript": "^5.1.6" } }, "require-directory": { diff --git a/tasks/ReplaceTokensV6/package.json b/tasks/ReplaceTokensV6/package.json index 1f08369..dcd36d3 100644 --- a/tasks/ReplaceTokensV6/package.json +++ b/tasks/ReplaceTokensV6/package.json @@ -10,7 +10,7 @@ "@opentelemetry/semantic-conventions": "^1.22.0", "@qetza/replacetokens": "^1.6.0", "axios": "^1.6.7", - "azure-pipelines-task-lib": "^4.1.0", + "azure-pipelines-task-lib": "^4.13.0", "js-yaml": "^4.1.0", "replacetokens-task": "file:../.." }, @@ -18,7 +18,7 @@ "@types/chai": "^4.3.12", "@types/js-yaml": "^4.0.9", "@types/mocha": "^10.0.6", - "@types/node": "^16.11.39", + "@types/node": "^20.3.1", "chai": "^4.4.1" } } diff --git a/tasks/ReplaceTokensV6/task.json b/tasks/ReplaceTokensV6/task.json index e320fa1..6c3d337 100644 --- a/tasks/ReplaceTokensV6/task.json +++ b/tasks/ReplaceTokensV6/task.json @@ -12,7 +12,7 @@ "author": "Guillaume ROUCHON", "version": { "Major": 6, - "Minor": 1, + "Minor": 2, "Patch": 0 }, "releaseNotes": "breaking changes, see [changelog](https://github.com/qetza/replacetokens-task/blob/master/tasks/ReplaceTokensV6/CHANGELOG.md)", @@ -314,6 +314,10 @@ "Node16": { "target": "index.js", "argumentFormat": "" + }, + "Node20_1": { + "target": "index.js", + "argumentFormat": "" } } } \ No newline at end of file diff --git a/vss-extension.json b/vss-extension.json index 285941b..968119b 100644 --- a/vss-extension.json +++ b/vss-extension.json @@ -2,7 +2,7 @@ "manifestVersion": 1, "id": "replacetokens", "name": "Replace Tokens", - "version": "5.1.0", + "version": "5.2.0", "public": true, "publisher": "qetza", "targets": [ From 512fa240b5975c609f3d7071b29aeb44e9571712 Mon Sep 17 00:00:00 2001 From: Guillaume ROUCHON Date: Tue, 25 Mar 2025 08:48:43 +0100 Subject: [PATCH 2/3] v5: add node20 --- CHANGELOG.md | 3 + tasks/ReplaceTokensV5/CHANGELOG.md | 3 + tasks/ReplaceTokensV5/package-lock.json | 105 +--- tasks/ReplaceTokensV5/package.json | 4 +- tasks/ReplaceTokensV5/task.json | 6 +- tasks/ReplaceTokensV5/tests/L0.ts | 452 ++++++++---------- .../telemetry/L0_TelemetryDisabledByInput.ts | 4 +- .../L0_TelemetryDisabledByVariable.ts | 4 +- 8 files changed, 236 insertions(+), 345 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bbabc22..5ef9632 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ Task 6.2.0 - Add Node 20 support ([#74](https://github.com/qetza/replacetokens-task/issues/74)). +Task 5.5.0 +- Add Node 20 support ([#74](https://github.com/qetza/replacetokens-task/issues/74)). + ## 5.1.0 Task 6.1.0 - Add _useAdditionalVariablesOnly_ parameter ([#29](https://github.com/qetza/replacetokens-task/issues/60)). diff --git a/tasks/ReplaceTokensV5/CHANGELOG.md b/tasks/ReplaceTokensV5/CHANGELOG.md index 513948b..f3aec0d 100644 --- a/tasks/ReplaceTokensV5/CHANGELOG.md +++ b/tasks/ReplaceTokensV5/CHANGELOG.md @@ -1,4 +1,7 @@ # Changelog +## 5.5.0 +- Add Node 20 support ([#74](https://github.com/qetza/replacetokens-task/issues/74)). + ## 5.4.0 - Add _useAdditionalVariablesOnly_ parameter ([#29](https://github.com/qetza/replacetokens-task/issues/60)). diff --git a/tasks/ReplaceTokensV5/package-lock.json b/tasks/ReplaceTokensV5/package-lock.json index 65239a8..f033b90 100644 --- a/tasks/ReplaceTokensV5/package-lock.json +++ b/tasks/ReplaceTokensV5/package-lock.json @@ -7,7 +7,7 @@ "": { "name": "replacetokens-v5", "dependencies": { - "azure-pipelines-task-lib": "^4.1.0", + "azure-pipelines-task-lib": "^4.13.0", "iconv-lite": "^0.4.15", "js-yaml": "^4.0.0", "jschardet": "^2.2.1" @@ -16,7 +16,7 @@ "@types/chai": "^4.3.12", "@types/js-yaml": "^4.0.9", "@types/mocha": "^10.0.6", - "@types/node": "^10.17.60", + "@types/node": "^20.3.1", "chai": "^4.4.1" } }, @@ -39,10 +39,11 @@ "dev": true }, "node_modules/@types/node": { - "version": "10.17.60", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", - "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", - "dev": true + "version": "20.3.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.1.tgz", + "integrity": "sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg==", + "dev": true, + "license": "MIT" }, "node_modules/adm-zip": { "version": "0.5.10", @@ -99,12 +100,12 @@ } }, "node_modules/azure-pipelines-task-lib": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-4.10.0.tgz", - "integrity": "sha512-/j5nwVEPYx/WV/5H66BuMK3ubrKYFgbFc0yPmEwfXvDwNbgXeIHtcXXZGHiCVq2q+JmHcFYav9sfOrCq2O2Bdg==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-4.13.0.tgz", + "integrity": "sha512-KVguui31If98vgokNepHUxE3/D8UFB4FHV1U6XxjGOkgxxwKxbupC3knVnEiZA/hNl7X+vmj9KrYOx79iwmezQ==", + "license": "MIT", "dependencies": { "adm-zip": "^0.5.10", - "deasync": "^0.1.28", "minimatch": "3.0.5", "nodejs-file-downloader": "^4.11.1", "q": "^1.5.1", @@ -118,14 +119,6 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "node_modules/bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "dependencies": { - "file-uri-to-path": "1.0.0" - } - }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -170,19 +163,6 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, - "node_modules/deasync": { - "version": "0.1.29", - "resolved": "https://registry.npmjs.org/deasync/-/deasync-0.1.29.tgz", - "integrity": "sha512-EBtfUhVX23CE9GR6m+F8WPeImEE4hR/FW9RkK0PMl9V1t283s0elqsTD8EZjaKX28SY1BW2rYfCgNsAYdpamUw==", - "hasInstallScript": true, - "dependencies": { - "bindings": "^1.5.0", - "node-addon-api": "^1.7.1" - }, - "engines": { - "node": ">=0.11.0" - } - }, "node_modules/deep-eql": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", @@ -195,21 +175,17 @@ "node": ">=6" } }, - "node_modules/file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" - }, "node_modules/follow-redirects": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", "funding": [ { "type": "individual", "url": "https://github.com/sponsors/RubenVerborgh" } ], + "license": "MIT", "engines": { "node": ">=4.0" }, @@ -406,11 +382,6 @@ "node": "*" } }, - "node_modules/node-addon-api": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.7.2.tgz", - "integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==" - }, "node_modules/nodejs-file-downloader": { "version": "4.12.1", "resolved": "https://registry.npmjs.org/nodejs-file-downloader/-/nodejs-file-downloader-4.12.1.tgz", @@ -593,9 +564,9 @@ "dev": true }, "@types/node": { - "version": "10.17.60", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", - "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", + "version": "20.3.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.1.tgz", + "integrity": "sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg==", "dev": true }, "adm-zip": { @@ -638,12 +609,11 @@ "dev": true }, "azure-pipelines-task-lib": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-4.10.0.tgz", - "integrity": "sha512-/j5nwVEPYx/WV/5H66BuMK3ubrKYFgbFc0yPmEwfXvDwNbgXeIHtcXXZGHiCVq2q+JmHcFYav9sfOrCq2O2Bdg==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-4.13.0.tgz", + "integrity": "sha512-KVguui31If98vgokNepHUxE3/D8UFB4FHV1U6XxjGOkgxxwKxbupC3knVnEiZA/hNl7X+vmj9KrYOx79iwmezQ==", "requires": { "adm-zip": "^0.5.10", - "deasync": "^0.1.28", "minimatch": "3.0.5", "nodejs-file-downloader": "^4.11.1", "q": "^1.5.1", @@ -657,14 +627,6 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "requires": { - "file-uri-to-path": "1.0.0" - } - }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -703,15 +665,6 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, - "deasync": { - "version": "0.1.29", - "resolved": "https://registry.npmjs.org/deasync/-/deasync-0.1.29.tgz", - "integrity": "sha512-EBtfUhVX23CE9GR6m+F8WPeImEE4hR/FW9RkK0PMl9V1t283s0elqsTD8EZjaKX28SY1BW2rYfCgNsAYdpamUw==", - "requires": { - "bindings": "^1.5.0", - "node-addon-api": "^1.7.1" - } - }, "deep-eql": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", @@ -721,15 +674,10 @@ "type-detect": "^4.0.0" } }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" - }, "follow-redirects": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==" + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==" }, "fs.realpath": { "version": "1.0.0", @@ -870,11 +818,6 @@ "brace-expansion": "^1.1.7" } }, - "node-addon-api": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.7.2.tgz", - "integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==" - }, "nodejs-file-downloader": { "version": "4.12.1", "resolved": "https://registry.npmjs.org/nodejs-file-downloader/-/nodejs-file-downloader-4.12.1.tgz", diff --git a/tasks/ReplaceTokensV5/package.json b/tasks/ReplaceTokensV5/package.json index ae608b6..154f5c2 100644 --- a/tasks/ReplaceTokensV5/package.json +++ b/tasks/ReplaceTokensV5/package.json @@ -2,7 +2,7 @@ "name": "replacetokens-v5", "author": "Guillaume ROUCHON", "dependencies": { - "azure-pipelines-task-lib": "^4.1.0", + "azure-pipelines-task-lib": "^4.13.0", "iconv-lite": "^0.4.15", "js-yaml": "^4.0.0", "jschardet": "^2.2.1" @@ -11,7 +11,7 @@ "@types/chai": "^4.3.12", "@types/js-yaml": "^4.0.9", "@types/mocha": "^10.0.6", - "@types/node": "^10.17.60", + "@types/node": "^20.3.1", "chai": "^4.4.1" } } diff --git a/tasks/ReplaceTokensV5/task.json b/tasks/ReplaceTokensV5/task.json index 692ab2a..ed97f1e 100644 --- a/tasks/ReplaceTokensV5/task.json +++ b/tasks/ReplaceTokensV5/task.json @@ -12,7 +12,7 @@ "author": "Guillaume ROUCHON", "version": { "Major": 5, - "Minor": 4, + "Minor": 5, "Patch": 0 }, "releaseNotes": "Migrate to Node10 handler (breaking change).
Add Node16 handler.", @@ -357,6 +357,10 @@ "Node16": { "target": "index.js", "argumentFormat": "" + }, + "Node20_1": { + "target": "index.js", + "argumentFormat": "" } } } \ No newline at end of file diff --git a/tasks/ReplaceTokensV5/tests/L0.ts b/tasks/ReplaceTokensV5/tests/L0.ts index f7dab44..0505067 100644 --- a/tasks/ReplaceTokensV5/tests/L0.ts +++ b/tasks/ReplaceTokensV5/tests/L0.ts @@ -11,17 +11,14 @@ const tmp = path.join(__dirname, '_tmp'); describe('ReplaceTokens v5 L0 suite', function () { this.timeout(10000); - function runValidation(validator: () => void, tr: ttm.MockTestRunner, done: Mocha.Done) { + function runValidation(validator: () => void, tr: ttm.MockTestRunner) { try { validator(); - done(); } catch (err) { - console.log('STDERR'); - console.log(tr.stderr); - console.log('STDOUT'); - console.log(tr.stdout); + console.log('STDERR', tr.stderr); + console.log('STDOUT', tr.stdout); - done(err); + throw err; } } @@ -91,25 +88,24 @@ describe('ReplaceTokens v5 L0 suite', function () { }); describe('telemetry', function () { - it('should not call telemetry when disabled by input', function (done: Mocha.Done) { + it('should not call telemetry when disabled by input', async () => { // arrange let tp: string = path.join(__dirname, 'telemetry', 'L0_TelemetryDisabledByInput.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); // act - tr.run(); + await tr.runAsync(); // assert runValidation( () => { tr.stdout.should.not.include('sent usage telemetry:'); }, - tr, - done + tr ); }); - it('should not call telemetry when disabled by REPLACETOKENS_DISABLE_TELEMETRY', function (done: Mocha.Done) { + it('should not call telemetry when disabled by REPLACETOKENS_DISABLE_TELEMETRY', async () => { // arrange let tp = path.join(__dirname, 'telemetry', 'L0_TelemetryDisabledByVariable.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -117,7 +113,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['REPLACETOKENS_DISABLE_TELEMETRY'] = 'true'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -125,12 +121,11 @@ describe('ReplaceTokens v5 L0 suite', function () { tr.stdout.should.not.include('telemetry sent'); tr.stdout.should.not.include('sent usage telemetry:'); }, - tr, - done + tr ); }); - it('should not call telemetry when disabled by REPLACETOKENS_TELEMETRY_OPTOUT', function (done: Mocha.Done) { + it('should not call telemetry when disabled by REPLACETOKENS_TELEMETRY_OPTOUT', async () => { // arrange let tp = path.join(__dirname, 'telemetry', 'L0_TelemetryDisabledByVariable.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -138,7 +133,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['REPLACETOKENS_TELEMETRY_OPTOUT'] = 'true'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -146,18 +141,17 @@ describe('ReplaceTokens v5 L0 suite', function () { tr.stdout.should.not.include('telemetry sent'); tr.stdout.should.not.include('sent usage telemetry:'); }, - tr, - done + tr ); }); - it('should call telemetry on failure', function (done: Mocha.Done) { + it('should call telemetry on failure', async () => { // arrange let tp = path.join(__dirname, 'telemetry', 'L0_TelemetryOnFailure.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -169,12 +163,11 @@ describe('ReplaceTokens v5 L0 suite', function () { /\[\{"account":"494d0aad9d06c4ddb51d5300620122ce55366a9382b3cc2835ed5f0e2e67b4d0","pipeline":"b98ed03d3eec376dcc015365c1a944e3ebbcc33d30e3261af3f4e4abb107aa82","host":"server","os":"Windows","result":"failed","eventType":"TokensReplaced","application":"replacetokens-task","version":"5.0.0"}]/ ); }, - tr, - done + tr ); }); - it('should call telemetry on success', function (done: Mocha.Done) { + it('should call telemetry on success', async () => { // arrange let tp = path.join(__dirname, 'telemetry', 'L0_TelemetryOnSuccess.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -182,7 +175,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__inputpath__'] = copyData('default.json', 'default_telemetryonsuccess.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -194,14 +187,13 @@ describe('ReplaceTokens v5 L0 suite', function () { /\[\{"account":"494d0aad9d06c4ddb51d5300620122ce55366a9382b3cc2835ed5f0e2e67b4d0","pipeline":"b98ed03d3eec376dcc015365c1a944e3ebbcc33d30e3261af3f4e4abb107aa82","host":"server","os":"Windows","actionOnMissing":"warn","encoding":"auto","keepToken":false,"pattern":"#\\\\{\\\\s\*\(\(\?:\(\?!#\\\\{\)\(\?!\\\\s\*\\\\}#\)\.\)\*\)\\\\s\*\\\\}#","result":"success","rules":1,"rulesWithInputWildcard":0,"rulesWithNegativePattern":0,"rulesWithOutputPattern":0,"tokenPrefix":"#{","tokenSuffix":"}#","variableFiles":0,"verbosity":"normal","writeBOM":true,"useLegacyPattern":false,"enableTransforms":false,"transformPrefix":"\(","transformSuffix":"\)","transformPattern":"\\\\s\*\(\.\*\)\\\\\(\\\\s\*\(\(\?:\(\?!\\\\\(\)\(\?!\\\\s\*\\\\\)\)\.\)\*\)\\\\s\*\\\\\)\\\\s\*","defaultValue":"","tokenPattern":"default","actionOnNoFiles":"continue","inlineVariables":0,"enableRecursion":false,"useLegacyEmptyFeature":false,"useDefaultValue":false,"useAdditionalVariablesOnly":false,"duration":\d+(?:\.\d+)?,"tokenReplaced":1,"tokenFound":1,"defaultValueReplaced":0,"fileProcessed":1,"transformExecuted":0,"eventType":"TokensReplaced","application":"replacetokens-task","version":"5.0.0"}]/ ); }, - tr, - done + tr ); }); }); describe('target files', function () { - it('should replace inline when no output path', function (done: Mocha.Done) { + it('should replace inline when no output path', async () => { // arrange let tp = path.join(__dirname, 'targetFiles', 'L0_InlineReplace.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -209,7 +201,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__inputpath__'] = copyData('default.json', 'default_inlinereplace.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -218,12 +210,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace multiple inline when no output path', function (done: Mocha.Done) { + it('should replace multiple inline when no output path', async () => { // arrange let tp = path.join(__dirname, 'targetFiles', 'L0_MultipleInlineReplace.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -232,7 +223,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__inputpath2__'] = copyData('default.json', 'default_inlinereplace2.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -242,12 +233,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath1__'], path.join(data, 'default.expected.json'), 'replaced output in first file'); assertFilesEqual(process.env['__inputpath2__'], path.join(data, 'default.expected.json'), 'replaced output in second file'); }, - tr, - done + tr ); }); - it('should replace in other file when relative output path', function (done: Mocha.Done) { + it('should replace in other file when relative output path', async () => { // arrange let tp = path.join(__dirname, 'targetFiles', 'L0_OutputReplace.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -256,7 +246,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__outputpath__'] = path.join('output', 'default_relativeoutputreplace.output.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -266,12 +256,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(path.join(tmp, process.env['__outputpath__']), path.join(data, 'default.expected.json'), 'replaced output'); assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.json'), 'input'); }, - tr, - done + tr ); }); - it('should replace in other file when absolute output path', function (done: Mocha.Done) { + it('should replace in other file when absolute output path', async () => { // arrange let tp = path.join(__dirname, 'targetFiles', 'L0_OutputReplace.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -280,7 +269,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__outputpath__'] = path.join(tmp, 'output', 'default_absoluteoutputreplace.output.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -290,12 +279,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__outputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.json'), 'input'); }, - tr, - done + tr ); }); - it('should replace in other file when wildcard and output path', function (done: Mocha.Done) { + it('should replace in other file when wildcard and output path', async () => { // arrange let tp = path.join(__dirname, 'targetFiles', 'L0_WildcardReplace.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -305,7 +293,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__outputpath__'] = path.join('output', 'default_wildcardreplace.*.output.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -315,14 +303,13 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(path.join(tmp, 'output', 'default_wildcardreplace.dev.output.json'), path.join(data, 'default.expected.json'), 'replaced output'); assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.json'), 'input'); }, - tr, - done + tr ); }); }); describe('token pattern', function () { - it('should replace when default pattern', function (done: Mocha.Done) { + it('should replace when default pattern', async () => { // arrange let tp = path.join(__dirname, 'tokenPattern', 'L0_TokenPattern.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -331,7 +318,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__tokenpattern__'] = 'default'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -340,12 +327,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace when rm pattern', function (done: Mocha.Done) { + it('should replace when rm pattern', async () => { // arrange let tp = path.join(__dirname, 'tokenPattern', 'L0_TokenPattern.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -354,7 +340,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__tokenpattern__'] = 'rm'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -363,12 +349,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace when octopus pattern', function (done: Mocha.Done) { + it('should replace when octopus pattern', async () => { // arrange let tp = path.join(__dirname, 'tokenPattern', 'L0_TokenPattern.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -377,7 +362,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__tokenpattern__'] = 'octopus'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -386,12 +371,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace when azpipelines pattern', function (done: Mocha.Done) { + it('should replace when azpipelines pattern', async () => { // arrange let tp = path.join(__dirname, 'tokenPattern', 'L0_TokenPattern.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -400,7 +384,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__tokenpattern__'] = 'azpipelines'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -409,12 +393,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace when doublebraces pattern', function (done: Mocha.Done) { + it('should replace when doublebraces pattern', async () => { // arrange let tp = path.join(__dirname, 'tokenPattern', 'L0_TokenPattern.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -423,7 +406,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__tokenpattern__'] = 'doublebraces'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -432,12 +415,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace when custom pattern', function (done: Mocha.Done) { + it('should replace when custom pattern', async () => { // arrange let tp = path.join(__dirname, 'tokenPattern', 'L0_CustomTokenPattern.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -445,7 +427,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__inputpath__'] = copyData('default.custom.json', 'default_customtokenpattern.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -454,12 +436,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace when legacy pattern', function (done: Mocha.Done) { + it('should replace when legacy pattern', async () => { // arrange let tp = path.join(__dirname, 'tokenPattern', 'L0_LegacyTokenPattern.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -467,7 +448,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__inputpath__'] = copyData('default.json', 'default_legacytokenpattern.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -476,12 +457,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should no replace when legacy pattern', function (done: Mocha.Done) { + it('should no replace when legacy pattern', async () => { // arrange let tp = path.join(__dirname, 'tokenPattern', 'L0_LegacyTokenPattern.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -489,7 +469,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__inputpath__'] = copyData('default.json', 'default_newtokenpattern.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -498,14 +478,13 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); }); describe('keep token', function () { - it('should replace with empty when not keeping token', function (done: Mocha.Done) { + it('should replace with empty when not keeping token', async () => { // arrange let tp = path.join(__dirname, 'keepToken', 'L0_KeepToken.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -514,7 +493,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__keeptoken__'] = 'false'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -523,12 +502,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_noreplace.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace with token when keeping token', function (done: Mocha.Done) { + it('should replace with token when keeping token', async () => { // arrange let tp = path.join(__dirname, 'keepToken', 'L0_KeepToken.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -537,7 +515,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__keeptoken__'] = 'true'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -546,14 +524,13 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.json'), 'replaced output'); }, - tr, - done + tr ); }); }); describe('transforms', function () { - it('should uppercase replaced value with transform', function (done: Mocha.Done) { + it('should uppercase replaced value with transform', async () => { // arrange let tp = path.join(__dirname, 'transforms', 'L0_TransformValue.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -562,7 +539,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['VAR1'] = 'var1_value'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -571,12 +548,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'transform.upper.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should lowercase replaced value with transform', function (done: Mocha.Done) { + it('should lowercase replaced value with transform', async () => { // arrange let tp = path.join(__dirname, 'transforms', 'L0_TransformValue.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -585,7 +561,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['VAR1'] = 'VAR1_VALUE'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -594,12 +570,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'transform.lower.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should base64 replaced value with transform', function (done: Mocha.Done) { + it('should base64 replaced value with transform', async () => { // arrange let tp = path.join(__dirname, 'transforms', 'L0_TransformValue.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -608,7 +583,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['VAR1'] = 'var1_value'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -617,12 +592,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'transform.base64.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should not escape replaced value with transform', function (done: Mocha.Done) { + it('should not escape replaced value with transform', async () => { // arrange let tp = path.join(__dirname, 'transforms', 'L0_TransformValue.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -631,7 +605,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['VAR1'] = '"var1_value"'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -640,12 +614,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'transform.noescape.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should transform replaced value with custom transform pattern', function (done: Mocha.Done) { + it('should transform replaced value with custom transform pattern', async () => { // arrange let tp = path.join(__dirname, 'transforms', 'L0_TransformPattern.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -653,7 +626,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__inputpath__'] = copyData('transform.custom.json', 'transform_custom.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -662,12 +635,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'transform.upper.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should indent replaced value with transform', function (done: Mocha.Done) { + it('should indent replaced value with transform', async () => { // arrange let tp = path.join(__dirname, 'transforms', 'L0_TransformValue.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -676,7 +648,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['VAR1'] = 'line1\nline2\nline3'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -685,14 +657,13 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'transform.indent.expected.yml'), 'replaced output'); }, - tr, - done + tr ); }); }); describe('action on missing', function () { - it('should display information on missing value when continue silently', function (done: Mocha.Done) { + it('should display information on missing value when continue silently', async () => { // arrange let tp = path.join(__dirname, 'actionOnMissing', 'L0_ActionOnMissing.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -701,7 +672,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__actiononmissing__'] = 'continue'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -710,12 +681,11 @@ describe('ReplaceTokens v5 L0 suite', function () { tr.stdout.should.include('##vso[task.debug] variable not found: var1'); }, - tr, - done + tr ); }); - it('should display warn on missing value when warning', function (done: Mocha.Done) { + it('should display warn on missing value when warning', async () => { // arrange let tp = path.join(__dirname, 'actionOnMissing', 'L0_ActionOnMissing.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -724,7 +694,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__actiononmissing__'] = 'warn'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -733,12 +703,11 @@ describe('ReplaceTokens v5 L0 suite', function () { tr.stdout.should.include('##vso[task.issue type=warning;source=TaskInternal;] variable not found: var1'); }, - tr, - done + tr ); }); - it('should fail on missing value when fail', function (done: Mocha.Done) { + it('should fail on missing value when fail', async () => { // arrange let tp = path.join(__dirname, 'actionOnMissing', 'L0_ActionOnMissing.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -747,7 +716,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__actiononmissing__'] = 'fail'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -756,14 +725,13 @@ describe('ReplaceTokens v5 L0 suite', function () { tr.stdout.should.include('##vso[task.issue type=error;source=TaskInternal;] variable not found: var1'); }, - tr, - done + tr ); }); }); describe('logs', function () { - it('should log minimal when normal', function (done: Mocha.Done) { + it('should log minimal when normal', async () => { // arrange let tp = path.join(__dirname, 'logs', 'L0_Verbosity.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -772,7 +740,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__verbosity__'] = 'normal'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -786,12 +754,11 @@ describe('ReplaceTokens v5 L0 suite', function () { tr.stdout.should.include('replaced 1 tokens out of 1 in 1 file(s)'); }, - tr, - done + tr ); }); - it('should log all when detailed', function (done: Mocha.Done) { + it('should log all when detailed', async () => { // arrange let tp = path.join(__dirname, 'logs', 'L0_Verbosity.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -800,7 +767,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__verbosity__'] = 'detailed'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -814,12 +781,11 @@ describe('ReplaceTokens v5 L0 suite', function () { tr.stdout.should.include('replaced 1 tokens out of 1 in 1 file(s)'); }, - tr, - done + tr ); }); - it('should not log when off', function (done: Mocha.Done) { + it('should not log when off', async () => { // arrange let tp = path.join(__dirname, 'logs', 'L0_Verbosity.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -828,7 +794,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__verbosity__'] = 'off'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -842,12 +808,11 @@ describe('ReplaceTokens v5 L0 suite', function () { tr.stdout.should.not.include('replaced 1 tokens out of 1 in 1 file(s)'); }, - tr, - done + tr ); }); - it('should log summary when replaced', function (done: Mocha.Done) { + it('should log summary when replaced', async () => { // arrange let tp = path.join(__dirname, 'logs', 'L0_Logs.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -856,7 +821,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__inputpath2__'] = copyData('logs.json', 'default_logs2.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -871,14 +836,13 @@ describe('ReplaceTokens v5 L0 suite', function () { tr.stdout.should.include('##vso[task.setvariable variable=transformExecutedCount;isOutput=false;issecret=false;]2'); tr.stdout.should.include('##vso[task.setvariable variable=defaultValueCount;isOutput=false;issecret=false;]2'); }, - tr, - done + tr ); }); }); describe('escape characters', function () { - it('should escape json when auto on .json', function (done: Mocha.Done) { + it('should escape json when auto on .json', async () => { // arrange let tp = path.join(__dirname, 'escapeChars', 'L0_EscapeType.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -888,7 +852,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['VAR1'] = '"var\\1\n\r\tvalue\b\f'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -897,12 +861,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_escape.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should escape xml when auto on .xml', function (done: Mocha.Done) { + it('should escape xml when auto on .xml', async () => { // arrange let tp = path.join(__dirname, 'escapeChars', 'L0_EscapeType.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -912,7 +875,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['VAR1'] = '"var\'1&'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -921,12 +884,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_escape.xml'), 'replaced output'); }, - tr, - done + tr ); }); - it('should not escape when none', function (done: Mocha.Done) { + it('should not escape when none', async () => { // arrange let tp = path.join(__dirname, 'escapeChars', 'L0_EscapeType.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -936,7 +898,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['VAR1'] = '"var\\1\n\r\tvalue\b\f'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -945,12 +907,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_noescape.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should escape json when json', function (done: Mocha.Done) { + it('should escape json when json', async () => { // arrange let tp = path.join(__dirname, 'escapeChars', 'L0_EscapeType.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -960,7 +921,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['VAR1'] = '"var\\1\n\r\tvalue\b\f'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -969,12 +930,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_escape.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should escape xml when xml', function (done: Mocha.Done) { + it('should escape xml when xml', async () => { // arrange let tp = path.join(__dirname, 'escapeChars', 'L0_EscapeType.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -984,7 +944,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['VAR1'] = '"var\'1&'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -993,12 +953,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_escape.xml'), 'replaced output'); }, - tr, - done + tr ); }); - it('should escape custom when custom', function (done: Mocha.Done) { + it('should escape custom when custom', async () => { // arrange let tp = path.join(__dirname, 'escapeChars', 'L0_CustomEscapeType.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1006,7 +965,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__inputpath__'] = copyData('default.json', 'default_customescape.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1015,14 +974,13 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_customescape.json'), 'replaced output'); }, - tr, - done + tr ); }); }); describe('action on no file', function () { - it('should display information on no file when continue silently', function (done: Mocha.Done) { + it('should display information on no file when continue silently', async () => { // arrange let tp = path.join(__dirname, 'actionOnNoFile', 'L0_ActionOnNoFile.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1030,7 +988,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__actiononnofiles__'] = 'continue'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1039,12 +997,11 @@ describe('ReplaceTokens v5 L0 suite', function () { tr.stdout.should.include('replaced 0 tokens out of 0 in 0 file(s)'); }, - tr, - done + tr ); }); - it('should display warn on no file when warn', function (done: Mocha.Done) { + it('should display warn on no file when warn', async () => { // arrange let tp = path.join(__dirname, 'actionOnNoFile', 'L0_ActionOnNoFile.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1052,7 +1009,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__actiononnofiles__'] = 'warn'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1061,12 +1018,11 @@ describe('ReplaceTokens v5 L0 suite', function () { tr.stdout.should.include('##vso[task.issue type=warning;source=TaskInternal;]found no files to process'); }, - tr, - done + tr ); }); - it('should fail on no file when fail', function (done: Mocha.Done) { + it('should fail on no file when fail', async () => { // arrange let tp = path.join(__dirname, 'actionOnNoFile', 'L0_ActionOnNoFile.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1074,7 +1030,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__actiononnofiles__'] = 'fail'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1083,14 +1039,13 @@ describe('ReplaceTokens v5 L0 suite', function () { tr.stdout.should.include('##vso[task.issue type=error;source=TaskInternal;]found no files to process'); }, - tr, - done + tr ); }); }); describe('empty value', function () { - it('should replace empty value when legacy', function (done: Mocha.Done) { + it('should replace empty value when legacy', async () => { // arrange let tp = path.join(__dirname, 'emptyValue', 'L0_LegacyEmptyValue.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1099,7 +1054,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['VAR1'] = ''; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1110,12 +1065,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_empty.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace empty value when new', function (done: Mocha.Done) { + it('should replace empty value when new', async () => { // arrange let tp = path.join(__dirname, 'emptyValue', 'L0_EmptyValue.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1123,7 +1077,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__inputpath__'] = copyData('default.json', 'default_empty.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1134,12 +1088,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_empty.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should not replace empty value when new and empty token', function (done: Mocha.Done) { + it('should not replace empty value when new and empty token', async () => { // arrange let tp = path.join(__dirname, 'emptyValue', 'L0_EmptyValue.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1148,7 +1101,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['VAR1'] = '(empty)'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1159,14 +1112,13 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_emptytoken.json'), 'replaced output'); }, - tr, - done + tr ); }); }); describe('default value', function () { - it('should not replace when legacy and no default', function (done: Mocha.Done) { + it('should not replace when legacy and no default', async () => { // arrange let tp = path.join(__dirname, 'defaultValue', 'L0_LegacyDefaultValue.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1175,7 +1127,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__defaultvalue__'] = ''; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1186,12 +1138,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_noreplace.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace with default when legacy and default', function (done: Mocha.Done) { + it('should replace with default when legacy and default', async () => { // arrange let tp = path.join(__dirname, 'defaultValue', 'L0_LegacyDefaultValue.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1200,7 +1151,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__defaultvalue__'] = '[default]'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1211,12 +1162,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_default.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace with empty when legacy and empty default', function (done: Mocha.Done) { + it('should replace with empty when legacy and empty default', async () => { // arrange let tp = path.join(__dirname, 'defaultValue', 'L0_LegacyDefaultValue.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1225,7 +1175,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__defaultvalue__'] = '(empty)'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1236,12 +1186,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_empty.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should not replace when no default', function (done: Mocha.Done) { + it('should not replace when no default', async () => { // arrange let tp = path.join(__dirname, 'defaultValue', 'L0_DefaultValue.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1251,7 +1200,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__defaultvalue__'] = ''; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1262,12 +1211,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_noreplace.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace with default when default', function (done: Mocha.Done) { + it('should replace with default when default', async () => { // arrange let tp = path.join(__dirname, 'defaultValue', 'L0_DefaultValue.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1277,7 +1225,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__defaultvalue__'] = '[default]'; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1288,12 +1236,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_default.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace with empty when empty default', function (done: Mocha.Done) { + it('should replace with empty when empty default', async () => { // arrange let tp = path.join(__dirname, 'defaultValue', 'L0_DefaultValue.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1303,7 +1250,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__defaultvalue__'] = ''; // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1314,14 +1261,13 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_empty.json'), 'replaced output'); }, - tr, - done + tr ); }); }); describe('recursion', function () { - it('should not replace recursively when recursion disabled', function (done: Mocha.Done) { + it('should not replace recursively when recursion disabled', async () => { // arrange let tp = path.join(__dirname, 'recursion', 'L0_DisabledRecursion.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1329,7 +1275,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__inputpath__'] = copyData('default.json', 'default_disabledrecursion.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1338,12 +1284,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_disabledrecursion.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace recursively when recursion', function (done: Mocha.Done) { + it('should replace recursively when recursion', async () => { // arrange let tp = path.join(__dirname, 'recursion', 'L0_Recursion.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1351,7 +1296,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__inputpath__'] = copyData('default.json', 'default_recursion.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1360,12 +1305,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should fail when cycle recursion', function (done: Mocha.Done) { + it('should fail when cycle recursion', async () => { // arrange let tp = path.join(__dirname, 'recursion', 'L0_CycleRecursion.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1373,7 +1317,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__inputpath__'] = copyData('default.json', 'default_cyclerecursion.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1383,14 +1327,13 @@ describe('ReplaceTokens v5 L0 suite', function () { tr.stdout.should.include("##vso[task.issue type=error;source=TaskInternal;]recursion cycle with token 'var1'."); tr.stdout.should.include("##vso[task.complete result=Failed;]recursion cycle with token 'var1'."); }, - tr, - done + tr ); }); }); describe('misc', function () { - it('should not replace when binary file', function (done: Mocha.Done) { + it('should not replace when binary file', async () => { // arrange let tp = path.join(__dirname, 'targetFiles', 'L0_InlineReplace.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1398,7 +1341,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__inputpath__'] = copyData('binary.jpg', 'binary.jpg'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1417,14 +1360,13 @@ describe('ReplaceTokens v5 L0 suite', function () { actual.should.equal(expected, 'replaced output'); }, - tr, - done + tr ); }); }); describe('external variables', function () { - it('should replace with inline variables in single document', function (done: Mocha.Done) { + it('should replace with inline variables in single document', async () => { // arrange let tp = path.join(__dirname, 'externalVariables', 'L0_InlineVariablesSingleDocument.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1432,7 +1374,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__inputpath__'] = copyData('variables.json', 'inlinevariables_singledocument.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1441,12 +1383,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace with inline variables in multiple documents', function (done: Mocha.Done) { + it('should replace with inline variables in multiple documents', async () => { // arrange let tp = path.join(__dirname, 'externalVariables', 'L0_InlineVariablesMultipleDocuments.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1454,7 +1395,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__inputpath__'] = copyData('variables.json', 'inlinevariables_multipledocuments.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1463,12 +1404,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace with variables from JSON file', function (done: Mocha.Done) { + it('should replace with variables from JSON file', async () => { // arrange let tp = path.join(__dirname, 'externalVariables', 'L0_SingleFile.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1477,7 +1417,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__variablespath__'] = path.join(data, 'externalvariables.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1486,12 +1426,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace with variables from JSON file with comments', function (done: Mocha.Done) { + it('should replace with variables from JSON file with comments', async () => { // arrange let tp = path.join(__dirname, 'externalVariables', 'L0_SingleFile.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1500,7 +1439,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__variablespath__'] = path.join(data, 'externalvariables_comments.jsonc'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1509,12 +1448,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace with variables from multiple JSON files', function (done: Mocha.Done) { + it('should replace with variables from multiple JSON files', async () => { // arrange let tp = path.join(__dirname, 'externalVariables', 'L0_MultipleFiles.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1524,7 +1462,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__variablespath2__'] = path.join(data, 'externalvariables2.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1533,12 +1471,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace with variables from YAML single document file', function (done: Mocha.Done) { + it('should replace with variables from YAML single document file', async () => { // arrange let tp = path.join(__dirname, 'externalVariables', 'L0_SingleFile.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1547,7 +1484,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__variablespath__'] = path.join(data, 'externalvariables_single.yml'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1556,12 +1493,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace with variables from YAML multiple document file', function (done: Mocha.Done) { + it('should replace with variables from YAML multiple document file', async () => { // arrange let tp = path.join(__dirname, 'externalVariables', 'L0_SingleFile.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1570,7 +1506,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__variablespath__'] = path.join(data, 'externalvariables_multiple.yml'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1579,12 +1515,11 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); - it('should replace only with file or inline variables when specified', function (done: Mocha.Done) { + it('should replace only with file or inline variables when specified', async () => { // arrange let tp = path.join(__dirname, 'externalVariables', 'L0_UseAdditionalVariablesOnly.js'); let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp); @@ -1593,7 +1528,7 @@ describe('ReplaceTokens v5 L0 suite', function () { process.env['__variablespath__'] = path.join(data, 'externalvariables1.json'); // act - tr.run(); + await tr.runAsync(); // assert runValidation( @@ -1602,8 +1537,7 @@ describe('ReplaceTokens v5 L0 suite', function () { assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.useadditionalvariablesonly.expected.json'), 'replaced output'); }, - tr, - done + tr ); }); }); diff --git a/tasks/ReplaceTokensV5/tests/telemetry/L0_TelemetryDisabledByInput.ts b/tasks/ReplaceTokensV5/tests/telemetry/L0_TelemetryDisabledByInput.ts index c51eaa0..9330e00 100644 --- a/tasks/ReplaceTokensV5/tests/telemetry/L0_TelemetryDisabledByInput.ts +++ b/tasks/ReplaceTokensV5/tests/telemetry/L0_TelemetryDisabledByInput.ts @@ -22,8 +22,10 @@ requestClone.on = function () { requestClone.write = function () { return true; }; -requestClone.end = function () { +requestClone.end = function (callback?: () => void) { console.log('telemetry sent'); + + return this; }; const httpsClone = Object.assign({}, https); diff --git a/tasks/ReplaceTokensV5/tests/telemetry/L0_TelemetryDisabledByVariable.ts b/tasks/ReplaceTokensV5/tests/telemetry/L0_TelemetryDisabledByVariable.ts index b762672..2acfe7b 100644 --- a/tasks/ReplaceTokensV5/tests/telemetry/L0_TelemetryDisabledByVariable.ts +++ b/tasks/ReplaceTokensV5/tests/telemetry/L0_TelemetryDisabledByVariable.ts @@ -22,8 +22,10 @@ requestClone.on = function () { requestClone.write = function () { return true; }; -requestClone.end = function () { +requestClone.end = function (callback?: () => void) { console.log('telemetry sent'); + + return this; }; const httpsClone = Object.assign({}, https); From ca27ee2c7f4613427a0fd065bd5fe89370719154 Mon Sep 17 00:00:00 2001 From: Guillaume ROUCHON Date: Sat, 29 Mar 2025 17:39:49 +0100 Subject: [PATCH 3/3] fix formatting --- tasks/ReplaceTokensV5/tests/L0.ts | 895 ++++++++++++------------------ 1 file changed, 353 insertions(+), 542 deletions(-) diff --git a/tasks/ReplaceTokensV5/tests/L0.ts b/tasks/ReplaceTokensV5/tests/L0.ts index 0505067..1300659 100644 --- a/tasks/ReplaceTokensV5/tests/L0.ts +++ b/tasks/ReplaceTokensV5/tests/L0.ts @@ -97,12 +97,9 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.stdout.should.not.include('sent usage telemetry:'); - }, - tr - ); + runValidation(() => { + tr.stdout.should.not.include('sent usage telemetry:'); + }, tr); }); it('should not call telemetry when disabled by REPLACETOKENS_DISABLE_TELEMETRY', async () => { @@ -116,13 +113,10 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.stdout.should.not.include('telemetry sent'); - tr.stdout.should.not.include('sent usage telemetry:'); - }, - tr - ); + runValidation(() => { + tr.stdout.should.not.include('telemetry sent'); + tr.stdout.should.not.include('sent usage telemetry:'); + }, tr); }); it('should not call telemetry when disabled by REPLACETOKENS_TELEMETRY_OPTOUT', async () => { @@ -136,13 +130,10 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.stdout.should.not.include('telemetry sent'); - tr.stdout.should.not.include('sent usage telemetry:'); - }, - tr - ); + runValidation(() => { + tr.stdout.should.not.include('telemetry sent'); + tr.stdout.should.not.include('sent usage telemetry:'); + }, tr); }); it('should call telemetry on failure', async () => { @@ -154,17 +145,14 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(false, 'task succeeded'); - - tr.stdout.should.include('telemetry sent'); - tr.stdout.should.match( - /\[\{"account":"494d0aad9d06c4ddb51d5300620122ce55366a9382b3cc2835ed5f0e2e67b4d0","pipeline":"b98ed03d3eec376dcc015365c1a944e3ebbcc33d30e3261af3f4e4abb107aa82","host":"server","os":"Windows","result":"failed","eventType":"TokensReplaced","application":"replacetokens-task","version":"5.0.0"}]/ - ); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(false, 'task succeeded'); + + tr.stdout.should.include('telemetry sent'); + tr.stdout.should.match( + /\[\{"account":"494d0aad9d06c4ddb51d5300620122ce55366a9382b3cc2835ed5f0e2e67b4d0","pipeline":"b98ed03d3eec376dcc015365c1a944e3ebbcc33d30e3261af3f4e4abb107aa82","host":"server","os":"Windows","result":"failed","eventType":"TokensReplaced","application":"replacetokens-task","version":"5.0.0"}]/ + ); + }, tr); }); it('should call telemetry on success', async () => { @@ -178,17 +166,14 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - tr.stdout.should.include('telemetry sent'); - tr.stdout.should.match( - /\[\{"account":"494d0aad9d06c4ddb51d5300620122ce55366a9382b3cc2835ed5f0e2e67b4d0","pipeline":"b98ed03d3eec376dcc015365c1a944e3ebbcc33d30e3261af3f4e4abb107aa82","host":"server","os":"Windows","actionOnMissing":"warn","encoding":"auto","keepToken":false,"pattern":"#\\\\{\\\\s\*\(\(\?:\(\?!#\\\\{\)\(\?!\\\\s\*\\\\}#\)\.\)\*\)\\\\s\*\\\\}#","result":"success","rules":1,"rulesWithInputWildcard":0,"rulesWithNegativePattern":0,"rulesWithOutputPattern":0,"tokenPrefix":"#{","tokenSuffix":"}#","variableFiles":0,"verbosity":"normal","writeBOM":true,"useLegacyPattern":false,"enableTransforms":false,"transformPrefix":"\(","transformSuffix":"\)","transformPattern":"\\\\s\*\(\.\*\)\\\\\(\\\\s\*\(\(\?:\(\?!\\\\\(\)\(\?!\\\\s\*\\\\\)\)\.\)\*\)\\\\s\*\\\\\)\\\\s\*","defaultValue":"","tokenPattern":"default","actionOnNoFiles":"continue","inlineVariables":0,"enableRecursion":false,"useLegacyEmptyFeature":false,"useDefaultValue":false,"useAdditionalVariablesOnly":false,"duration":\d+(?:\.\d+)?,"tokenReplaced":1,"tokenFound":1,"defaultValueReplaced":0,"fileProcessed":1,"transformExecuted":0,"eventType":"TokensReplaced","application":"replacetokens-task","version":"5.0.0"}]/ - ); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + tr.stdout.should.include('telemetry sent'); + tr.stdout.should.match( + /\[\{"account":"494d0aad9d06c4ddb51d5300620122ce55366a9382b3cc2835ed5f0e2e67b4d0","pipeline":"b98ed03d3eec376dcc015365c1a944e3ebbcc33d30e3261af3f4e4abb107aa82","host":"server","os":"Windows","actionOnMissing":"warn","encoding":"auto","keepToken":false,"pattern":"#\\\\{\\\\s\*\(\(\?:\(\?!#\\\\{\)\(\?!\\\\s\*\\\\}#\)\.\)\*\)\\\\s\*\\\\}#","result":"success","rules":1,"rulesWithInputWildcard":0,"rulesWithNegativePattern":0,"rulesWithOutputPattern":0,"tokenPrefix":"#{","tokenSuffix":"}#","variableFiles":0,"verbosity":"normal","writeBOM":true,"useLegacyPattern":false,"enableTransforms":false,"transformPrefix":"\(","transformSuffix":"\)","transformPattern":"\\\\s\*\(\.\*\)\\\\\(\\\\s\*\(\(\?:\(\?!\\\\\(\)\(\?!\\\\s\*\\\\\)\)\.\)\*\)\\\\s\*\\\\\)\\\\s\*","defaultValue":"","tokenPattern":"default","actionOnNoFiles":"continue","inlineVariables":0,"enableRecursion":false,"useLegacyEmptyFeature":false,"useDefaultValue":false,"useAdditionalVariablesOnly":false,"duration":\d+(?:\.\d+)?,"tokenReplaced":1,"tokenFound":1,"defaultValueReplaced":0,"fileProcessed":1,"transformExecuted":0,"eventType":"TokensReplaced","application":"replacetokens-task","version":"5.0.0"}]/ + ); + }, tr); }); }); @@ -204,14 +189,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); + }, tr); }); it('should replace multiple inline when no output path', async () => { @@ -226,15 +208,12 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath1__'], path.join(data, 'default.expected.json'), 'replaced output in first file'); - assertFilesEqual(process.env['__inputpath2__'], path.join(data, 'default.expected.json'), 'replaced output in second file'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath1__'], path.join(data, 'default.expected.json'), 'replaced output in first file'); + assertFilesEqual(process.env['__inputpath2__'], path.join(data, 'default.expected.json'), 'replaced output in second file'); + }, tr); }); it('should replace in other file when relative output path', async () => { @@ -249,15 +228,12 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(path.join(tmp, process.env['__outputpath__']), path.join(data, 'default.expected.json'), 'replaced output'); - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.json'), 'input'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(path.join(tmp, process.env['__outputpath__']), path.join(data, 'default.expected.json'), 'replaced output'); + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.json'), 'input'); + }, tr); }); it('should replace in other file when absolute output path', async () => { @@ -272,15 +248,12 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__outputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.json'), 'input'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__outputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.json'), 'input'); + }, tr); }); it('should replace in other file when wildcard and output path', async () => { @@ -296,15 +269,12 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(path.join(tmp, 'output', 'default_wildcardreplace.dev.output.json'), path.join(data, 'default.expected.json'), 'replaced output'); - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.json'), 'input'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(path.join(tmp, 'output', 'default_wildcardreplace.dev.output.json'), path.join(data, 'default.expected.json'), 'replaced output'); + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.json'), 'input'); + }, tr); }); }); @@ -321,14 +291,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); + }, tr); }); it('should replace when rm pattern', async () => { @@ -343,14 +310,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); + }, tr); }); it('should replace when octopus pattern', async () => { @@ -365,14 +329,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); + }, tr); }); it('should replace when azpipelines pattern', async () => { @@ -387,14 +348,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); + }, tr); }); it('should replace when doublebraces pattern', async () => { @@ -409,14 +367,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); + }, tr); }); it('should replace when custom pattern', async () => { @@ -430,14 +385,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); + }, tr); }); it('should replace when legacy pattern', async () => { @@ -451,14 +403,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); + }, tr); }); it('should no replace when legacy pattern', async () => { @@ -472,14 +421,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); + }, tr); }); }); @@ -496,14 +442,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_noreplace.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_noreplace.json'), 'replaced output'); + }, tr); }); it('should replace with token when keeping token', async () => { @@ -518,14 +461,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.json'), 'replaced output'); + }, tr); }); }); @@ -542,14 +482,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'transform.upper.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'transform.upper.expected.json'), 'replaced output'); + }, tr); }); it('should lowercase replaced value with transform', async () => { @@ -564,14 +501,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'transform.lower.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'transform.lower.expected.json'), 'replaced output'); + }, tr); }); it('should base64 replaced value with transform', async () => { @@ -586,14 +520,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'transform.base64.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'transform.base64.expected.json'), 'replaced output'); + }, tr); }); it('should not escape replaced value with transform', async () => { @@ -608,14 +539,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'transform.noescape.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'transform.noescape.expected.json'), 'replaced output'); + }, tr); }); it('should transform replaced value with custom transform pattern', async () => { @@ -629,14 +557,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'transform.upper.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'transform.upper.expected.json'), 'replaced output'); + }, tr); }); it('should indent replaced value with transform', async () => { @@ -651,14 +576,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'transform.indent.expected.yml'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'transform.indent.expected.yml'), 'replaced output'); + }, tr); }); }); @@ -675,14 +597,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - tr.stdout.should.include('##vso[task.debug] variable not found: var1'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + tr.stdout.should.include('##vso[task.debug] variable not found: var1'); + }, tr); }); it('should display warn on missing value when warning', async () => { @@ -697,14 +616,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - tr.stdout.should.include('##vso[task.issue type=warning;source=TaskInternal;] variable not found: var1'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + tr.stdout.should.include('##vso[task.issue type=warning;source=TaskInternal;] variable not found: var1'); + }, tr); }); it('should fail on missing value when fail', async () => { @@ -719,14 +635,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(false, 'task succeeded'); - - tr.stdout.should.include('##vso[task.issue type=error;source=TaskInternal;] variable not found: var1'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(false, 'task succeeded'); + + tr.stdout.should.include('##vso[task.issue type=error;source=TaskInternal;] variable not found: var1'); + }, tr); }); }); @@ -743,19 +656,16 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - tr.stdout.should.include('##[group]replacing tokens in: ' + process.env['__inputpath__']); - tr.stdout.should.not.include('\n using encoding: ascii'); - tr.stdout.should.not.include('\n var1: var1_value'); - tr.stdout.should.include('1 token(s) replaced out of 1'); - - tr.stdout.should.include('replaced 1 tokens out of 1 in 1 file(s)'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + tr.stdout.should.include('##[group]replacing tokens in: ' + process.env['__inputpath__']); + tr.stdout.should.not.include('\n using encoding: ascii'); + tr.stdout.should.not.include('\n var1: var1_value'); + tr.stdout.should.include('1 token(s) replaced out of 1'); + + tr.stdout.should.include('replaced 1 tokens out of 1 in 1 file(s)'); + }, tr); }); it('should log all when detailed', async () => { @@ -770,19 +680,16 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - tr.stdout.should.include('##[group]replacing tokens in: ' + process.env['__inputpath__']); - tr.stdout.should.include('\n using encoding: ascii'); - tr.stdout.should.include('\n var1: var1_value'); - tr.stdout.should.include('1 token(s) replaced out of 1'); - - tr.stdout.should.include('replaced 1 tokens out of 1 in 1 file(s)'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + tr.stdout.should.include('##[group]replacing tokens in: ' + process.env['__inputpath__']); + tr.stdout.should.include('\n using encoding: ascii'); + tr.stdout.should.include('\n var1: var1_value'); + tr.stdout.should.include('1 token(s) replaced out of 1'); + + tr.stdout.should.include('replaced 1 tokens out of 1 in 1 file(s)'); + }, tr); }); it('should not log when off', async () => { @@ -797,19 +704,16 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - tr.stdout.should.not.include('##[group]replacing tokens in: ' + process.env['__inputpath__']); - tr.stdout.should.not.include('\n using encoding: ascii'); - tr.stdout.should.not.include('\n var1: var1_value'); - tr.stdout.should.not.include('1 token(s) replaced out of 1'); - - tr.stdout.should.not.include('replaced 1 tokens out of 1 in 1 file(s)'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + tr.stdout.should.not.include('##[group]replacing tokens in: ' + process.env['__inputpath__']); + tr.stdout.should.not.include('\n using encoding: ascii'); + tr.stdout.should.not.include('\n var1: var1_value'); + tr.stdout.should.not.include('1 token(s) replaced out of 1'); + + tr.stdout.should.not.include('replaced 1 tokens out of 1 in 1 file(s)'); + }, tr); }); it('should log summary when replaced', async () => { @@ -824,20 +728,17 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - tr.stdout.should.include('replaced 8 tokens out of 8 (using 2 default value(s)) and running 2 functions in 2 file(s)'); - - tr.stdout.should.include('##vso[task.setvariable variable=tokenReplacedCount;isOutput=false;issecret=false;]8'); - tr.stdout.should.include('##vso[task.setvariable variable=tokenFoundCount;isOutput=false;issecret=false;]8'); - tr.stdout.should.include('##vso[task.setvariable variable=fileProcessedCount;isOutput=false;issecret=false;]2'); - tr.stdout.should.include('##vso[task.setvariable variable=transformExecutedCount;isOutput=false;issecret=false;]2'); - tr.stdout.should.include('##vso[task.setvariable variable=defaultValueCount;isOutput=false;issecret=false;]2'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + tr.stdout.should.include('replaced 8 tokens out of 8 (using 2 default value(s)) and running 2 functions in 2 file(s)'); + + tr.stdout.should.include('##vso[task.setvariable variable=tokenReplacedCount;isOutput=false;issecret=false;]8'); + tr.stdout.should.include('##vso[task.setvariable variable=tokenFoundCount;isOutput=false;issecret=false;]8'); + tr.stdout.should.include('##vso[task.setvariable variable=fileProcessedCount;isOutput=false;issecret=false;]2'); + tr.stdout.should.include('##vso[task.setvariable variable=transformExecutedCount;isOutput=false;issecret=false;]2'); + tr.stdout.should.include('##vso[task.setvariable variable=defaultValueCount;isOutput=false;issecret=false;]2'); + }, tr); }); }); @@ -855,14 +756,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_escape.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_escape.json'), 'replaced output'); + }, tr); }); it('should escape xml when auto on .xml', async () => { @@ -878,14 +776,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_escape.xml'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_escape.xml'), 'replaced output'); + }, tr); }); it('should not escape when none', async () => { @@ -901,14 +796,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_noescape.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_noescape.json'), 'replaced output'); + }, tr); }); it('should escape json when json', async () => { @@ -924,14 +816,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_escape.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_escape.json'), 'replaced output'); + }, tr); }); it('should escape xml when xml', async () => { @@ -947,14 +836,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_escape.xml'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_escape.xml'), 'replaced output'); + }, tr); }); it('should escape custom when custom', async () => { @@ -968,14 +854,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_customescape.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_customescape.json'), 'replaced output'); + }, tr); }); }); @@ -991,14 +874,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - tr.stdout.should.include('replaced 0 tokens out of 0 in 0 file(s)'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + tr.stdout.should.include('replaced 0 tokens out of 0 in 0 file(s)'); + }, tr); }); it('should display warn on no file when warn', async () => { @@ -1012,14 +892,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - tr.stdout.should.include('##vso[task.issue type=warning;source=TaskInternal;]found no files to process'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + tr.stdout.should.include('##vso[task.issue type=warning;source=TaskInternal;]found no files to process'); + }, tr); }); it('should fail on no file when fail', async () => { @@ -1033,14 +910,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(false, 'task succeeded'); - - tr.stdout.should.include('##vso[task.issue type=error;source=TaskInternal;]found no files to process'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(false, 'task succeeded'); + + tr.stdout.should.include('##vso[task.issue type=error;source=TaskInternal;]found no files to process'); + }, tr); }); }); @@ -1057,16 +931,13 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); - tr.stdout.should.not.include('##vso[task.debug] variable not found: var1'); + tr.stdout.should.not.include('##vso[task.debug] variable not found: var1'); - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_empty.json'), 'replaced output'); - }, - tr - ); + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_empty.json'), 'replaced output'); + }, tr); }); it('should replace empty value when new', async () => { @@ -1080,16 +951,13 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); - tr.stdout.should.not.include('##vso[task.debug] variable not found: var1'); + tr.stdout.should.not.include('##vso[task.debug] variable not found: var1'); - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_empty.json'), 'replaced output'); - }, - tr - ); + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_empty.json'), 'replaced output'); + }, tr); }); it('should not replace empty value when new and empty token', async () => { @@ -1104,16 +972,13 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); - tr.stdout.should.not.include('##vso[task.debug] variable not found: var1'); + tr.stdout.should.not.include('##vso[task.debug] variable not found: var1'); - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_emptytoken.json'), 'replaced output'); - }, - tr - ); + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_emptytoken.json'), 'replaced output'); + }, tr); }); }); @@ -1130,16 +995,13 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); - tr.stdout.should.include('##vso[task.issue type=warning;source=TaskInternal;] variable not found: var1'); + tr.stdout.should.include('##vso[task.issue type=warning;source=TaskInternal;] variable not found: var1'); - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_noreplace.json'), 'replaced output'); - }, - tr - ); + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_noreplace.json'), 'replaced output'); + }, tr); }); it('should replace with default when legacy and default', async () => { @@ -1154,16 +1016,13 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); - tr.stdout.should.include('##vso[task.debug] var1: [default] (default value)'); + tr.stdout.should.include('##vso[task.debug] var1: [default] (default value)'); - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_default.json'), 'replaced output'); - }, - tr - ); + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_default.json'), 'replaced output'); + }, tr); }); it('should replace with empty when legacy and empty default', async () => { @@ -1178,16 +1037,13 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); - tr.stdout.should.include('##vso[task.debug] var1: (default value)'); + tr.stdout.should.include('##vso[task.debug] var1: (default value)'); - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_empty.json'), 'replaced output'); - }, - tr - ); + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_empty.json'), 'replaced output'); + }, tr); }); it('should not replace when no default', async () => { @@ -1203,16 +1059,13 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); - tr.stdout.should.include('##vso[task.issue type=warning;source=TaskInternal;] variable not found: var1'); + tr.stdout.should.include('##vso[task.issue type=warning;source=TaskInternal;] variable not found: var1'); - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_noreplace.json'), 'replaced output'); - }, - tr - ); + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_noreplace.json'), 'replaced output'); + }, tr); }); it('should replace with default when default', async () => { @@ -1228,16 +1081,13 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); - tr.stdout.should.include('##vso[task.debug] var1: [default] (default value)'); + tr.stdout.should.include('##vso[task.debug] var1: [default] (default value)'); - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_default.json'), 'replaced output'); - }, - tr - ); + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_default.json'), 'replaced output'); + }, tr); }); it('should replace with empty when empty default', async () => { @@ -1253,16 +1103,13 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); - tr.stdout.should.include('##vso[task.debug] var1: (default value)'); + tr.stdout.should.include('##vso[task.debug] var1: (default value)'); - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_empty.json'), 'replaced output'); - }, - tr - ); + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_empty.json'), 'replaced output'); + }, tr); }); }); @@ -1278,14 +1125,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_disabledrecursion.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected_disabledrecursion.json'), 'replaced output'); + }, tr); }); it('should replace recursively when recursion', async () => { @@ -1299,14 +1143,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'default.expected.json'), 'replaced output'); + }, tr); }); it('should fail when cycle recursion', async () => { @@ -1320,15 +1161,12 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(false, 'task succeeded'); - - tr.stdout.should.include("##vso[task.issue type=error;source=TaskInternal;]recursion cycle with token 'var1'."); - tr.stdout.should.include("##vso[task.complete result=Failed;]recursion cycle with token 'var1'."); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(false, 'task succeeded'); + + tr.stdout.should.include("##vso[task.issue type=error;source=TaskInternal;]recursion cycle with token 'var1'."); + tr.stdout.should.include("##vso[task.complete result=Failed;]recursion cycle with token 'var1'."); + }, tr); }); }); @@ -1344,24 +1182,21 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - let buffer: Buffer = fs.readFileSync(process.env['__inputpath__']); - let hash = crypto.createHash('sha256'); - hash.update(buffer); - let actual: string = hash.digest('hex'); - - buffer = fs.readFileSync(path.join(data, 'binary.jpg')); - hash = crypto.createHash('sha256'); - hash.update(buffer); - let expected: string = hash.digest('hex'); - - actual.should.equal(expected, 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + let buffer: Buffer = fs.readFileSync(process.env['__inputpath__']); + let hash = crypto.createHash('sha256'); + hash.update(buffer); + let actual: string = hash.digest('hex'); + + buffer = fs.readFileSync(path.join(data, 'binary.jpg')); + hash = crypto.createHash('sha256'); + hash.update(buffer); + let expected: string = hash.digest('hex'); + + actual.should.equal(expected, 'replaced output'); + }, tr); }); }); @@ -1377,14 +1212,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); + }, tr); }); it('should replace with inline variables in multiple documents', async () => { @@ -1398,14 +1230,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); + }, tr); }); it('should replace with variables from JSON file', async () => { @@ -1420,14 +1249,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); + }, tr); }); it('should replace with variables from JSON file with comments', async () => { @@ -1442,14 +1268,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); + }, tr); }); it('should replace with variables from multiple JSON files', async () => { @@ -1465,14 +1288,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); + }, tr); }); it('should replace with variables from YAML single document file', async () => { @@ -1487,14 +1307,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); + }, tr); }); it('should replace with variables from YAML multiple document file', async () => { @@ -1509,14 +1326,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.expected.json'), 'replaced output'); + }, tr); }); it('should replace only with file or inline variables when specified', async () => { @@ -1531,14 +1345,11 @@ describe('ReplaceTokens v5 L0 suite', function () { await tr.runAsync(); // assert - runValidation( - () => { - tr.succeeded.should.equal(true, 'task succeeded'); - - assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.useadditionalvariablesonly.expected.json'), 'replaced output'); - }, - tr - ); + runValidation(() => { + tr.succeeded.should.equal(true, 'task succeeded'); + + assertFilesEqual(process.env['__inputpath__'], path.join(data, 'variables.useadditionalvariablesonly.expected.json'), 'replaced output'); + }, tr); }); }); });