diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3385d692e..515a6bd54 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,4 +38,5 @@ Your pull request should: * At least one test should fail in the absence of your non-test code changes. If your PR does not match this criteria, please specify why * Tests should include reasonable permutations of the target fix/change * Include baseline changes with your change - * All changed code must have 100% code coverage \ No newline at end of file + * All changed code must have 100% code coverage + diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 42914e225..ff7e5648d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,10 +4,10 @@ trigger: - releases/* variables: -- group: npm-tokens -- name: nodeVersion - value: '10.23.0' - + - group: npm-tokens + - name: nodeVersion + value: '16.13.0' + jobs: ################################################# - job: windows @@ -17,11 +17,12 @@ jobs: vmImage: windows-2019 steps: - - template: azure-pipelines-steps-node.yml - parameters: - nodeVersion: $(nodeVersion) - - template: azure-pipelines-steps-test-build.yml - + - template: azure-pipelines-steps-node.yml + parameters: + nodeVersion: $(nodeVersion) + + - template: azure-pipelines-steps-test-build.yml + ################################################# - job: linux ################################################# @@ -59,7 +60,8 @@ jobs: vmImage: macOS-10.15 steps: - - template: azure-pipelines-steps-node.yml - parameters: - nodeVersion: $(nodeVersion) - - template: azure-pipelines-steps-test-build.yml \ No newline at end of file + - template: azure-pipelines-steps-node.yml + parameters: + nodeVersion: $(nodeVersion) + + - template: azure-pipelines-steps-test-build.yml diff --git a/node/CHANGELOG.md b/node/CHANGELOG.md new file mode 100644 index 000000000..4691bcbc1 --- /dev/null +++ b/node/CHANGELOG.md @@ -0,0 +1,34 @@ +# Node.js task lib changes + +## 3.x + +### 3.3.1 + +- Update minimatch to version 3.0.5 to fix vulnerability - [#836](https://github.com/microsoft/azure-pipelines-task-lib/pull/836) + +### 3.4.0 + +- Updated mockery and mocha dependencies - [#875](https://github.com/microsoft/azure-pipelines-task-lib/pull/875) + +- Include uncought exceptions stack trace to the output logs - [#895](https://github.com/microsoft/azure-pipelines-task-lib/pull/895) + +## 4.x + +### 4.0.0-preview + +- Introduced support for node 16 task handler - [#844](https://github.com/microsoft/azure-pipelines-task-lib/pull/844) + +### 4.0.1-preview + +- Added node16 to task.schema.json - [#852](https://github.com/microsoft/azure-pipelines-task-lib/pull/852) +- fix ToolRunner - _getSpawnSyncOptions - [#873](https://github.com/microsoft/azure-pipelines-task-lib/pull/873) + +### 4.0.2 + +- Updated mockery because of vulnerabilities - [#878](https://github.com/microsoft/azure-pipelines-task-lib/pull/878) + +## 4.1.0 + +Backported from ver.`3.4.0`: + +- Include uncought exceptions stack trace to the output logs - [#895](https://github.com/microsoft/azure-pipelines-task-lib/pull/895) diff --git a/node/buildutils.js b/node/buildutils.js index 13192e0d9..1ecd94bbe 100644 --- a/node/buildutils.js +++ b/node/buildutils.js @@ -35,7 +35,7 @@ exports.getExternals = function () { // and add node to the PATH var nodeUrl = process.env['TASK_NODE_URL'] || 'https://nodejs.org/dist'; nodeUrl = nodeUrl.replace(/\/$/, ''); // ensure there is no trailing slash on the base URL - var nodeVersion = 'v10.23.0'; + var nodeVersion = 'v16.13.0'; switch (platform) { case 'darwin': var nodeArchivePath = downloadArchive(nodeUrl + '/' + nodeVersion + '/node-' + nodeVersion + '-darwin-x64.tar.gz'); diff --git a/node/mock-test.ts b/node/mock-test.ts index 37d379a3b..4d973387e 100644 --- a/node/mock-test.ts +++ b/node/mock-test.ts @@ -143,20 +143,17 @@ export class MockTestRunner { let downloadVersion: string; switch (version) { - case 5: - downloadVersion = 'v5.10.1'; - break; case 6: downloadVersion = 'v6.17.1'; break; case 10: downloadVersion = 'v10.21.0'; break; - case 14: - downloadVersion = 'v14.11.0'; + case 16: + downloadVersion = 'v16.13.0'; break; default: - throw new Error('Invalid node version, must be 5, 6, 10, or 14 (received ' + version + ')'); + throw new Error('Invalid node version, must be 6, 10, or 16 (received ' + version + ')'); } // Install node in home directory if it isn't already there. @@ -170,12 +167,12 @@ export class MockTestRunner { } } - // Determines the correct version of node to use based on the contents of the task's task.json. Defaults to Node 14. + // Determines the correct version of node to use based on the contents of the task's task.json. Defaults to Node 16. private getNodeVersion(): number { const taskJsonPath: string = this.getTaskJsonPath(); if (!taskJsonPath) { - console.warn('Unable to find task.json, defaulting to use Node 14'); - return 10; + console.warn('Unable to find task.json, defaulting to use Node 16'); + return 16; } const taskJsonContents = fs.readFileSync(taskJsonPath, { encoding: 'utf-8' }); const taskJson: object = JSON.parse(taskJsonContents); @@ -188,9 +185,9 @@ export class MockTestRunner { ); const keys = Object.keys(execution); for (let i = 0; i < keys.length; i++) { - if (keys[i].toLowerCase() == 'node14') { - // Prefer node 14 and return immediately. - return 14; + if (keys[i].toLowerCase() == 'node16') { + // Prefer node 16 and return immediately. + return 16; } else if (keys[i].toLowerCase() == 'node10') { // Prefer node 10 and return immediately. return 10; @@ -200,8 +197,8 @@ export class MockTestRunner { } if (!nodeVersionFound) { - console.warn('Unable to determine execution type from task.json, defaulting to use Node 10'); - return 10; + console.warn('Unable to determine execution type from task.json, defaulting to use Node 16'); + return 16; } return 6; diff --git a/node/package-lock.json b/node/package-lock.json index 6e5a3110d..7bf741552 100644 --- a/node/package-lock.json +++ b/node/package-lock.json @@ -1,6 +1,6 @@ { "name": "azure-pipelines-task-lib", - "version": "3.3.2", + "version": "4.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -37,9 +37,9 @@ "dev": true }, "@types/mocha": { - "version": "5.2.7", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", - "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", + "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", "dev": true }, "@types/mockery": { @@ -49,9 +49,9 @@ "dev": true }, "@types/node": { - "version": "10.17.44", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.44.tgz", - "integrity": "sha512-vHPAyBX1ffLcy4fQHmDyIUMUb42gHZjPHU66nhvbMzAWJqHnySGZ6STwN3rwrnSd1FHB0DI/RWgGELgKSYRDmw==" + "version": "16.11.39", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.39.tgz", + "integrity": "sha512-K0MsdV42vPwm9L6UwhIxMAOmcvH/1OoVkZyCgEtVu4Wx7sElGloy/W7kMBNe/oJ7V/jW9BVt1F6RahH6e7tPXw==" }, "@types/q": { "version": "1.5.4", @@ -392,9 +392,9 @@ "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=" }, "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -632,31 +632,6 @@ "yargs-unparser": "2.0.0" }, "dependencies": { - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "dependencies": { - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - } - } - }, "minimatch": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", diff --git a/node/package.json b/node/package.json index 4d33254b8..aa7d571bb 100644 --- a/node/package.json +++ b/node/package.json @@ -1,6 +1,6 @@ { "name": "azure-pipelines-task-lib", - "version": "3.4.0", + "version": "4.1.0", "description": "Azure Pipelines Task SDK", "main": "./task.js", "typings": "./task.d.ts", @@ -37,13 +37,13 @@ }, "devDependencies": { "@types/minimatch": "3.0.3", - "@types/mocha": "^5.2.7", + "@types/mocha": "^9.1.1", "@types/mockery": "^1.4.29", - "@types/node": "^10.17.0", + "@types/node": "^16.11.39", "@types/q": "^1.5.4", "@types/semver": "^7.3.4", "@types/shelljs": "^0.8.8", - "mocha": "9.2.2", + "mocha": "^9.2.2", "typescript": "^4.0.0" } } diff --git a/node/test/dirtests.ts b/node/test/dirtests.ts index 9321eb539..2d5f32cd7 100644 --- a/node/test/dirtests.ts +++ b/node/test/dirtests.ts @@ -27,11 +27,11 @@ describe('Dir Operation Tests', function () { // this test verifies the expected version of node is being used to run the tests. // 5.10.1 is what ships in the 1.x and 2.x agent. - it('is expected version', (done: MochaDone) => { + it('is expected version', (done) => { this.timeout(1000); console.log('node version: ' + process.version); - const supportedNodeVersions = ['v5.10.1', 'v6.10.3', 'v6.17.1', 'v8.9.1', 'v10.17.0', 'v10.18.0', 'v10.23.0', 'v14.11.0']; + const supportedNodeVersions = ['v16.13.0']; if (supportedNodeVersions.indexOf(process.version) === -1) { assert.fail(`expected node node version to be one of ${supportedNodeVersions.map(o => o).join(', ')}. actual: ` + process.version); } @@ -562,7 +562,7 @@ describe('Dir Operation Tests', function () { } // find tests - it('returns hidden files with find', (done: MochaDone) => { + it('returns hidden files with find', (done) => { this.timeout(3000); // create the following layout: @@ -588,7 +588,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('returns depth first find', (done: MochaDone) => { + it('returns depth first find', (done) => { this.timeout(1000); // create the following layout: @@ -621,7 +621,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('returns empty when not exists', (done: MochaDone) => { + it('returns empty when not exists', (done) => { this.timeout(1000); let itemPaths: string[] = tl.find(path.join(testutil.getTestTemp(), 'nosuch')); @@ -630,7 +630,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('does not follow specified symlink', (done: MochaDone) => { + it('does not follow specified symlink', (done) => { this.timeout(1000); // create the following layout: @@ -649,7 +649,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('follows specified symlink when -H', (done: MochaDone) => { + it('follows specified symlink when -H', (done) => { this.timeout(1000); // create the following layout: @@ -671,7 +671,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('follows specified symlink when -L', (done: MochaDone) => { + it('follows specified symlink when -L', (done) => { this.timeout(1000); // create the following layout: @@ -693,7 +693,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('does not follow symlink', (done: MochaDone) => { + it('does not follow symlink', (done) => { this.timeout(1000); // create the following layout: @@ -716,7 +716,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('does not follow symlink when -H', (done: MochaDone) => { + it('does not follow symlink when -H', (done) => { this.timeout(1000); // create the following layout: @@ -741,7 +741,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('follows symlink when -L', (done: MochaDone) => { + it('follows symlink when -L', (done) => { this.timeout(1000); // create the following layout: @@ -767,7 +767,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('allows broken symlink', (done: MochaDone) => { + it('allows broken symlink', (done) => { this.timeout(1000); // create the following layout: @@ -794,7 +794,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('allows specified broken symlink', (done: MochaDone) => { + it('allows specified broken symlink', (done) => { this.timeout(1000); // create the following layout: @@ -812,7 +812,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('allows nested broken symlink when -H', (done: MochaDone) => { + it('allows nested broken symlink when -H', (done) => { this.timeout(1000); // create the following layout: @@ -841,7 +841,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('allows specified broken symlink with -H', (done: MochaDone) => { + it('allows specified broken symlink with -H', (done) => { this.timeout(1000); // create the following layout: @@ -862,7 +862,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('does not allow specified broken symlink when only -H', (done: MochaDone) => { + it('does not allow specified broken symlink when only -H', (done) => { this.timeout(1000); // create the following layout: @@ -887,7 +887,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('does not allow broken symlink when only -L', (done: MochaDone) => { + it('does not allow broken symlink when only -L', (done) => { this.timeout(1000); // create the following layout: @@ -910,7 +910,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('does not allow specied broken symlink when only -L', (done: MochaDone) => { + it('does not allow specied broken symlink when only -L', (done) => { this.timeout(1000); // create the following layout: @@ -935,7 +935,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('allow broken symlink with -L', (done: MochaDone) => { + it('allow broken symlink with -L', (done) => { this.timeout(1000); // create the following layout: @@ -966,7 +966,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('allow specified broken symlink with -L', (done: MochaDone) => { + it('allow specified broken symlink with -L', (done) => { this.timeout(1000); // create the following layout: @@ -988,7 +988,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('detects cycle', (done: MochaDone) => { + it('detects cycle', (done) => { this.timeout(1000); // create the following layout: @@ -1009,7 +1009,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('detects cycle starting from symlink', (done: MochaDone) => { + it('detects cycle starting from symlink', (done) => { this.timeout(1000); // create the following layout: @@ -1030,7 +1030,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('detects deep cycle starting from middle', (done: MochaDone) => { + it('detects deep cycle starting from middle', (done) => { this.timeout(1000); // create the following layout: @@ -1069,7 +1069,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('default options', (done: MochaDone) => { + it('default options', (done) => { this.timeout(1000); // create the following layout: @@ -1099,7 +1099,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('default options do not allow broken symlinks', (done: MochaDone) => { + it('default options do not allow broken symlinks', (done) => { this.timeout(1000); // create the following layout: @@ -1121,7 +1121,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('empty find path returns empty array', (done: MochaDone) => { + it('empty find path returns empty array', (done) => { this.timeout(1000); let actual: string[] = tl.find(''); @@ -1131,7 +1131,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('normalizes find path', (done: MochaDone) => { + it('normalizes find path', (done) => { this.timeout(1000); // create the following layout: @@ -1220,7 +1220,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('fails if mkdirP with conflicting file path', (done: MochaDone) => { + it('fails if mkdirP with conflicting file path', (done) => { this.timeout(1000); let testPath = path.join(testutil.getTestTemp(), 'mkdirP_conflicting_file_path'); @@ -1238,7 +1238,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('fails if mkdirP with conflicting parent file path', (done: MochaDone) => { + it('fails if mkdirP with conflicting parent file path', (done) => { this.timeout(1000); let testPath = path.join(testutil.getTestTemp(), 'mkdirP_conflicting_parent_file_path', 'dir'); @@ -1256,7 +1256,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('no-ops if mkdirP directory exists', (done: MochaDone) => { + it('no-ops if mkdirP directory exists', (done) => { this.timeout(1000); let testPath = path.join(testutil.getTestTemp(), 'mkdirP_dir_exists'); @@ -1268,7 +1268,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('no-ops if mkdirP with symlink directory', (done: MochaDone) => { + it('no-ops if mkdirP with symlink directory', (done) => { this.timeout(1000); // create the following layout: @@ -1294,7 +1294,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('no-ops if mkdirP with parent symlink directory', (done: MochaDone) => { + it('no-ops if mkdirP with parent symlink directory', (done) => { this.timeout(1000); // create the following layout: @@ -1320,7 +1320,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('breaks if mkdirP loop out of control', (done: MochaDone) => { + it('breaks if mkdirP loop out of control', (done) => { this.timeout(1000); let testPath = path.join(testutil.getTestTemp(), 'mkdirP_failsafe', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'); @@ -1432,7 +1432,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('removes file with rmRF', (done: MochaDone) => { + it('removes file with rmRF', (done) => { this.timeout(1000); let file: string = path.join(testutil.getTestTemp(), 'rmRF_file'); @@ -1444,7 +1444,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('removes hidden folder with rmRF', (done: MochaDone) => { + it('removes hidden folder with rmRF', (done) => { this.timeout(1000); let directory: string = path.join(testutil.getTestTemp(), '.rmRF_directory'); @@ -1456,7 +1456,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('removes hidden file with rmRF', (done: MochaDone) => { + it('removes hidden file with rmRF', (done) => { this.timeout(1000); let file: string = path.join(testutil.getTestTemp(), '.rmRF_file'); @@ -1468,7 +1468,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('removes symlink folder with rmRF', (done: MochaDone) => { + it('removes symlink folder with rmRF', (done) => { this.timeout(1000); // create the following layout: @@ -1494,7 +1494,7 @@ describe('Dir Operation Tests', function () { // creating a symlink to a file on Windows requires elevated if (os.platform() != 'win32') { - it('removes symlink file with rmRF', (done: MochaDone) => { + it('removes symlink file with rmRF', (done) => { this.timeout(1000); // create the following layout: @@ -1515,7 +1515,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('removes symlink file with missing source using rmRF', (done: MochaDone) => { + it('removes symlink file with missing source using rmRF', (done) => { this.timeout(1000); // create the following layout: @@ -1548,7 +1548,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('removes symlink level 2 file with rmRF', (done: MochaDone) => { + it('removes symlink level 2 file with rmRF', (done) => { this.timeout(1000); // create the following layout: @@ -1573,7 +1573,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('removes nested symlink file with rmRF', (done: MochaDone) => { + it('removes nested symlink file with rmRF', (done) => { this.timeout(1000); // create the following layout: @@ -1601,7 +1601,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('removes deeply nested symlink file with rmRF', (done: MochaDone) => { + it('removes deeply nested symlink file with rmRF', (done) => { this.timeout(1000); // create the following layout: @@ -1632,7 +1632,7 @@ describe('Dir Operation Tests', function () { }); } - it('removes symlink folder with missing source using rmRF', (done: MochaDone) => { + it('removes symlink folder with missing source using rmRF', (done) => { this.timeout(1000); // create the following layout: @@ -1651,7 +1651,7 @@ describe('Dir Operation Tests', function () { // remove the real directory fs.unlinkSync(realFile); fs.rmdirSync(realDirectory); - assert.throws(() => { fs.statSync(symlinkDirectory) }, (err) => err.code == 'ENOENT', 'stat should throw'); + assert.throws(() => { fs.statSync(symlinkDirectory) }, (err: NodeJS.ErrnoException) => err.code == 'ENOENT', 'stat should throw'); // remove the symlink directory tl.rmRF(symlinkDirectory); @@ -1668,7 +1668,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('removes symlink level 2 folder with rmRF', (done: MochaDone) => { + it('removes symlink level 2 folder with rmRF', (done) => { this.timeout(1000); // create the following layout: @@ -1700,7 +1700,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('removes nested symlink folder with rmRF', (done: MochaDone) => { + it('removes nested symlink folder with rmRF', (done) => { this.timeout(1000); // create the following layout: @@ -1728,7 +1728,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('removes deeply nested symlink folder with rmRF', (done: MochaDone) => { + it('removes deeply nested symlink folder with rmRF', (done) => { this.timeout(1000); // create the following layout: @@ -1758,7 +1758,7 @@ describe('Dir Operation Tests', function () { done(); }); - it('removes hidden file with rmRF', (done: MochaDone) => { + it('removes hidden file with rmRF', (done) => { this.timeout(1000); let file: string = path.join(testutil.getTestTemp(), '.rmRF_file'); @@ -1845,7 +1845,7 @@ describe('Dir Operation Tests', function () { }); // cp tests - it('copies file using -f', (done: MochaDone) => { + it('copies file using -f', (done) => { this.timeout(1000); let root: string = path.join(testutil.getTestTemp(), 'cp_with_-f'); diff --git a/node/test/fakeTasks/node14task/task.json b/node/test/fakeTasks/node16task/task.json similarity index 66% rename from node/test/fakeTasks/node14task/task.json rename to node/test/fakeTasks/node16task/task.json index a4825b6ec..4342d1603 100644 --- a/node/test/fakeTasks/node14task/task.json +++ b/node/test/fakeTasks/node16task/task.json @@ -1,8 +1,8 @@ { "id": "id", - "name": "Node14Task", + "name": "Node16Task", "execution": { - "Node14": { + "Node16": { "target": "usedotnet.js" } } diff --git a/node/test/filtertests.ts b/node/test/filtertests.ts index 04ea46474..110a7a4a9 100644 --- a/node/test/filtertests.ts +++ b/node/test/filtertests.ts @@ -20,7 +20,7 @@ describe('Filter Tests', function () { after(function () { }); - it('applies default option nobrace true', (done: MochaDone) => { + it('applies default option nobrace true', (done) => { this.timeout(1000); let list = [ @@ -38,7 +38,7 @@ describe('Filter Tests', function () { done(); }); - it('applies default option noglobstar false', (done: MochaDone) => { + it('applies default option noglobstar false', (done) => { this.timeout(1000); let list = [ @@ -58,7 +58,7 @@ describe('Filter Tests', function () { done(); }); - it('applies default option dot true', (done: MochaDone) => { + it('applies default option dot true', (done) => { this.timeout(1000); let list = [ @@ -75,7 +75,7 @@ describe('Filter Tests', function () { done(); }); - it('applies default option noext false', (done: MochaDone) => { + it('applies default option noext false', (done) => { this.timeout(1000); let list = [ @@ -94,7 +94,7 @@ describe('Filter Tests', function () { done(); }); - it('applies default option nocase based on platform', (done: MochaDone) => { + it('applies default option nocase based on platform', (done) => { this.timeout(1000); let list = [ @@ -114,7 +114,7 @@ describe('Filter Tests', function () { done(); }); - it('applies default option matchBase false', (done: MochaDone) => { + it('applies default option matchBase false', (done) => { this.timeout(1000); let list = [ @@ -131,7 +131,7 @@ describe('Filter Tests', function () { done(); }); - it('applies default option nocomment false', (done: MochaDone) => { + it('applies default option nocomment false', (done) => { this.timeout(1000); let list = [ @@ -145,7 +145,7 @@ describe('Filter Tests', function () { done(); }); - it('applies default option nonegate false', (done: MochaDone) => { + it('applies default option nonegate false', (done) => { this.timeout(1000); let list = [ @@ -162,7 +162,7 @@ describe('Filter Tests', function () { done(); }); - it('supports custom options', (done: MochaDone) => { + it('supports custom options', (done) => { this.timeout(1000); let list = [ diff --git a/node/test/findmatchtests.ts b/node/test/findmatchtests.ts index a0bcfc185..b09d231f9 100644 --- a/node/test/findmatchtests.ts +++ b/node/test/findmatchtests.ts @@ -23,7 +23,7 @@ describe('Find and Match Tests', function () { after(function () { }); - it('single pattern', (done: MochaDone) => { + it('single pattern', (done) => { this.timeout(1000); // create the following layout: @@ -46,7 +46,7 @@ describe('Find and Match Tests', function () { done(); }); - it('aggregates matches', (done: MochaDone) => { + it('aggregates matches', (done) => { this.timeout(1000); // create the following layout: @@ -73,7 +73,7 @@ describe('Find and Match Tests', function () { done(); }); - it('supports path not found', (done: MochaDone) => { + it('supports path not found', (done) => { this.timeout(1000); let root: string = path.join(testutil.getTestTemp(), 'find-and-match_supports-path-not-found'); @@ -89,7 +89,7 @@ describe('Find and Match Tests', function () { done(); }); - it('does not duplicate matches', (done: MochaDone) => { + it('does not duplicate matches', (done) => { this.timeout(1000); // create the following layout: @@ -121,7 +121,7 @@ describe('Find and Match Tests', function () { done(); }); - it('supports interleaved exclude patterns', (done: MochaDone) => { + it('supports interleaved exclude patterns', (done) => { this.timeout(1000); // create the following layout: @@ -168,7 +168,7 @@ describe('Find and Match Tests', function () { done(); }); - it('applies default match options', (done: MochaDone) => { + it('applies default match options', (done) => { this.timeout(1000); // create the following layout: @@ -252,7 +252,7 @@ describe('Find and Match Tests', function () { done(); }); - it('trims patterns', (done: MochaDone) => { + it('trims patterns', (done) => { this.timeout(1000); // create the following layout: @@ -274,7 +274,7 @@ describe('Find and Match Tests', function () { done(); }); - it('skips empty patterns', (done: MochaDone) => { + it('skips empty patterns', (done) => { this.timeout(1000); // create the following layout: @@ -298,7 +298,7 @@ describe('Find and Match Tests', function () { done(); }); - it('supports nocomment true', (done: MochaDone) => { + it('supports nocomment true', (done) => { this.timeout(1000); // create the following layout: @@ -320,7 +320,7 @@ describe('Find and Match Tests', function () { done(); }); - it('supports nobrace false', (done: MochaDone) => { + it('supports nobrace false', (done) => { this.timeout(1000); // create the following layout: @@ -345,7 +345,7 @@ describe('Find and Match Tests', function () { done(); }); - it('brace escaping platform-specific', (done: MochaDone) => { + it('brace escaping platform-specific', (done) => { this.timeout(1000); // create the following layout: @@ -380,7 +380,7 @@ describe('Find and Match Tests', function () { }); - it('supports nonegate true', (done: MochaDone) => { + it('supports nonegate true', (done) => { this.timeout(1000); // create the following layout: @@ -402,7 +402,7 @@ describe('Find and Match Tests', function () { done(); }); - it('supports flipNegate true', (done: MochaDone) => { + it('supports flipNegate true', (done) => { this.timeout(1000); // create the following layout: @@ -424,7 +424,7 @@ describe('Find and Match Tests', function () { done(); }); - it('supports matchBase include patterns', (done: MochaDone) => { + it('supports matchBase include patterns', (done) => { this.timeout(1000); // create the following layout: @@ -457,7 +457,7 @@ describe('Find and Match Tests', function () { done(); }); - it('supports matchBase include patterns with glob', (done: MochaDone) => { + it('supports matchBase include patterns with glob', (done) => { this.timeout(1000); // create the following layout: @@ -490,7 +490,7 @@ describe('Find and Match Tests', function () { done(); }); - it('supports matchBase exlude pattern', (done: MochaDone) => { + it('supports matchBase exlude pattern', (done) => { this.timeout(1000); // create the following layout: @@ -527,7 +527,7 @@ describe('Find and Match Tests', function () { done(); }); - it('counts leading negate markers', (done: MochaDone) => { + it('counts leading negate markers', (done) => { this.timeout(1000); // create the following layout: @@ -564,7 +564,7 @@ describe('Find and Match Tests', function () { done(); }); - it('trims whitespace after trimming negate markers', (done: MochaDone) => { + it('trims whitespace after trimming negate markers', (done) => { this.timeout(1000); // create the following layout: @@ -587,7 +587,7 @@ describe('Find and Match Tests', function () { done(); }); - it('evaluates comments before expanding braces', (done: MochaDone) => { + it('evaluates comments before expanding braces', (done) => { this.timeout(1000); // create the following layout: @@ -616,7 +616,7 @@ describe('Find and Match Tests', function () { done(); }); - it('evaluates negation before expanding braces', (done: MochaDone) => { + it('evaluates negation before expanding braces', (done) => { this.timeout(1000); // create the following layout: @@ -641,7 +641,7 @@ describe('Find and Match Tests', function () { done(); }); - it('evaluates comments before negation', (done: MochaDone) => { + it('evaluates comments before negation', (done) => { this.timeout(1000); // create the following layout: @@ -667,7 +667,7 @@ describe('Find and Match Tests', function () { done(); }); - it('escapes default root when rooting patterns', (done: MochaDone) => { + it('escapes default root when rooting patterns', (done) => { this.timeout(1000); // create the following layout: @@ -741,7 +741,7 @@ describe('Find and Match Tests', function () { done(); }); - it('applies default find options', (done: MochaDone) => { + it('applies default find options', (done) => { this.timeout(1000); // create the following layout: @@ -763,7 +763,7 @@ describe('Find and Match Tests', function () { done(); }); - it('supports custom find options', (done: MochaDone) => { + it('supports custom find options', (done) => { this.timeout(1000); // create the following layout: @@ -787,7 +787,7 @@ describe('Find and Match Tests', function () { done(); }); - it('default root falls back to System.DefaultWorkingDirectory', (done: MochaDone) => { + it('default root falls back to System.DefaultWorkingDirectory', (done) => { this.timeout(1000); let originalSystemDefaultWorkingDirectory = process.env['SYSTEM_DEFAULTWORKINGDIRECTORY']; @@ -815,7 +815,7 @@ describe('Find and Match Tests', function () { done(); }); - it('default root falls back to cwd', (done: MochaDone) => { + it('default root falls back to cwd', (done) => { this.timeout(1000); let originalSystemDefaultWorkingDirectory = process.env['SYSTEM_DEFAULTWORKINGDIRECTORY']; @@ -853,7 +853,7 @@ describe('Find and Match Tests', function () { } } - it('ensurePatternRooted()', (done: MochaDone) => { + it('ensurePatternRooted()', (done) => { this.timeout(1000); if (process.platform == 'win32') { @@ -932,7 +932,7 @@ describe('Find and Match Tests', function () { assert.deepEqual(actual, expected); } - it('getFindInfoFromPattern()', (done: MochaDone) => { + it('getFindInfoFromPattern()', (done) => { this.timeout(1000); // basename diff --git a/node/test/inputtests.ts b/node/test/inputtests.ts index aa0fa1509..76213d7fd 100644 --- a/node/test/inputtests.ts +++ b/node/test/inputtests.ts @@ -133,7 +133,7 @@ describe('Input Tests', function () { done(); }) - it('gets a variable with special characters', (done: MochaDone) => { + it('gets a variable with special characters', (done) => { this.timeout(1000); let expected = 'Value of var with special chars'; @@ -156,7 +156,7 @@ describe('Input Tests', function () { done(); }) - it('sets a variable with special chars as an env var', (done: MochaDone) => { + it('sets a variable with special chars as an env var', (done) => { this.timeout(1000); let expected = 'Set value of var with special chars'; diff --git a/node/test/internalhelpertests.ts b/node/test/internalhelpertests.ts index de81d52fb..10d62ee3e 100644 --- a/node/test/internalhelpertests.ts +++ b/node/test/internalhelpertests.ts @@ -32,7 +32,7 @@ describe('Internal Path Helper Tests', function () { `expected ensureRooted for input <${path}> to yield <${expected}>`); } - it('ensureRooted roots paths', (done: MochaDone) => { + it('ensureRooted roots paths', (done) => { this.timeout(1000); if (process.platform == 'win32') { @@ -120,7 +120,7 @@ describe('Internal Path Helper Tests', function () { `expected getDirectoryName for input <${path}> to yield <${expected}>`); } - it('getDirectoryName interprets directory name from paths', (done: MochaDone) => { + it('getDirectoryName interprets directory name from paths', (done) => { this.timeout(1000); assertDirectoryName(null, ''); @@ -244,7 +244,7 @@ describe('Internal Path Helper Tests', function () { `expected isRooted for input <${path}> to yield <${expected}>`); } - it('isRooted detects root', (done: MochaDone) => { + it('isRooted detects root', (done) => { this.timeout(1000); if (process.platform == 'win32') { @@ -335,7 +335,7 @@ describe('Internal Path Helper Tests', function () { `expected normalizeSeparators for input <${path}> to yield <${expected}>`); } - it('normalizeSeparators', (done: MochaDone) => { + it('normalizeSeparators', (done) => { this.timeout(1000); if (process.platform == 'win32') { @@ -403,7 +403,7 @@ describe('Internal Path Helper Tests', function () { done(); }); - it('ReportMissingStrings', (done: MochaDone) => { + it('ReportMissingStrings', (done) => { mockery.registerAllowable('../_build/internal') const fsMock = { @@ -425,7 +425,7 @@ describe('Internal Path Helper Tests', function () { done(); }); - it('ReportMissingLocalization', (done: MochaDone) => { + it('ReportMissingLocalization', (done) => { const localizedMessage : string = im._loc("gizmo", "whatever", "music"); assert.strictEqual(localizedMessage, "gizmo whatever music"); done(); diff --git a/node/test/isuncpathtests.ts b/node/test/isuncpathtests.ts index 9beb1cbe3..714ee3ed7 100644 --- a/node/test/isuncpathtests.ts +++ b/node/test/isuncpathtests.ts @@ -19,7 +19,7 @@ describe('Is UNC-path Tests', function () { after(function () { }); - it('checks if path is unc path', (done: MochaDone) => { + it('checks if path is unc path', (done) => { this.timeout(1000); const paths = [ diff --git a/node/test/legacyfindfilestests.ts b/node/test/legacyfindfilestests.ts index 89c7fd05b..01c1b36e0 100644 --- a/node/test/legacyfindfilestests.ts +++ b/node/test/legacyfindfilestests.ts @@ -24,7 +24,7 @@ describe('Legacy Find Files Tests', function () { after(function () { }); - it('supports directory name single char wildcard', (done: MochaDone) => { + it('supports directory name single char wildcard', (done) => { this.timeout(1000); // create the following layout: @@ -55,7 +55,7 @@ describe('Legacy Find Files Tests', function () { done(); }); - it('supports directory name wildcard', (done: MochaDone) => { + it('supports directory name wildcard', (done) => { this.timeout(1000); // create the following layout: @@ -86,7 +86,7 @@ describe('Legacy Find Files Tests', function () { done(); }); - it('supports exclude patterns', (done: MochaDone) => { + it('supports exclude patterns', (done) => { this.timeout(1000); // create the following layout: @@ -127,7 +127,7 @@ describe('Legacy Find Files Tests', function () { done(); }); - it('supports file name single char wildcard', (done: MochaDone) => { + it('supports file name single char wildcard', (done) => { this.timeout(1000); // create the following layout: @@ -154,7 +154,7 @@ describe('Legacy Find Files Tests', function () { done(); }); - it('supports file name wildcard', (done: MochaDone) => { + it('supports file name wildcard', (done) => { this.timeout(1000); // create the following layout: @@ -181,7 +181,7 @@ describe('Legacy Find Files Tests', function () { done(); }); - it('supports globstar', (done: MochaDone) => { + it('supports globstar', (done) => { this.timeout(1000); // create the following layout: @@ -214,7 +214,7 @@ describe('Legacy Find Files Tests', function () { done(); }); - it('supports include directories', (done: MochaDone) => { + it('supports include directories', (done) => { this.timeout(1000); // create the following layout: @@ -243,7 +243,7 @@ describe('Legacy Find Files Tests', function () { done(); }); - it('supports include directories only', (done: MochaDone) => { + it('supports include directories only', (done) => { this.timeout(1000); // create the following layout: @@ -270,7 +270,7 @@ describe('Legacy Find Files Tests', function () { done(); }); - it('supports inter-segment wildcard', (done: MochaDone) => { + it('supports inter-segment wildcard', (done) => { this.timeout(1000); // create the following layout: @@ -310,7 +310,7 @@ describe('Legacy Find Files Tests', function () { done(); }); - it('unions matches', (done: MochaDone) => { + it('unions matches', (done) => { this.timeout(1000); // create the following layout: @@ -338,7 +338,7 @@ describe('Legacy Find Files Tests', function () { done(); }); - it('has platform-specific case sensitivity', (done: MochaDone) => { + it('has platform-specific case sensitivity', (done) => { this.timeout(1000); // create the following layout: @@ -373,7 +373,7 @@ describe('Legacy Find Files Tests', function () { done(); }); - it('supports literal ; in pattern', (done: MochaDone) => { + it('supports literal ; in pattern', (done) => { this.timeout(1000); // create the following layout: @@ -395,7 +395,7 @@ describe('Legacy Find Files Tests', function () { done(); }); - it('supports literal ; in rootDirectory', (done: MochaDone) => { + it('supports literal ; in rootDirectory', (done) => { this.timeout(1000); // create the following layout: @@ -419,7 +419,7 @@ describe('Legacy Find Files Tests', function () { done(); }); - it('supports pattern is ;', (done: MochaDone) => { + it('supports pattern is ;', (done) => { this.timeout(1000); // create the following layout: @@ -441,7 +441,7 @@ describe('Legacy Find Files Tests', function () { done(); }); - it('does not support pattern with trailing slash', (done: MochaDone) => { + it('does not support pattern with trailing slash', (done) => { this.timeout(1000); let pattern = path.join(__dirname, 'hello', 'world') + '/'; @@ -455,7 +455,7 @@ describe('Legacy Find Files Tests', function () { } }); - it('has platform-specific support for pattern with trailing backslash', (done: MochaDone) => { + it('has platform-specific support for pattern with trailing backslash', (done) => { this.timeout(1000); if (process.platform == 'win32') { @@ -493,7 +493,7 @@ describe('Legacy Find Files Tests', function () { } }); - it('follows symlink dirs', (done: MochaDone) => { + it('follows symlink dirs', (done) => { this.timeout(1000); // create the following layout: @@ -528,7 +528,7 @@ describe('Legacy Find Files Tests', function () { done(); }); - it('supports alternate include syntax', (done: MochaDone) => { + it('supports alternate include syntax', (done) => { this.timeout(1000); // create the following layout: @@ -556,7 +556,7 @@ describe('Legacy Find Files Tests', function () { done(); }); - it('appends root directory', (done: MochaDone) => { + it('appends root directory', (done) => { this.timeout(1000); // create the following layout: @@ -584,7 +584,7 @@ describe('Legacy Find Files Tests', function () { done(); }); - it('supports hidden files', (done: MochaDone) => { + it('supports hidden files', (done) => { this.timeout(1000); // create the following layout: @@ -611,7 +611,7 @@ describe('Legacy Find Files Tests', function () { done(); }); - it('supports hidden folders', (done: MochaDone) => { + it('supports hidden folders', (done) => { this.timeout(1000); // create the following layout: @@ -662,7 +662,7 @@ describe('Legacy Find Files Tests', function () { `pattern '${pattern}' should not match path '${path}'`); } - it('converts patterns to RegExp', (done: MochaDone) => { + it('converts patterns to RegExp', (done) => { let tlAny = tl as any; if (process.platform == 'win32') { // should convert to forward slashes diff --git a/node/test/matchtests.ts b/node/test/matchtests.ts index 3aff887c9..373cc2b53 100644 --- a/node/test/matchtests.ts +++ b/node/test/matchtests.ts @@ -20,7 +20,7 @@ describe('Match Tests', function () { after(function () { }); - it('single pattern', (done: MochaDone) => { + it('single pattern', (done) => { this.timeout(1000); let list: string[] = [ @@ -38,7 +38,7 @@ describe('Match Tests', function () { done(); }); - it('aggregates matches', (done: MochaDone) => { + it('aggregates matches', (done) => { this.timeout(1000); let list: string[] = [ @@ -59,7 +59,7 @@ describe('Match Tests', function () { done(); }); - it('does not duplicate matches', (done: MochaDone) => { + it('does not duplicate matches', (done) => { this.timeout(1000); let list: string[] = [ @@ -83,7 +83,7 @@ describe('Match Tests', function () { done(); }); - it('preserves order', (done: MochaDone) => { + it('preserves order', (done) => { this.timeout(1000); let list: string[] = [ @@ -112,7 +112,7 @@ describe('Match Tests', function () { done(); }); - it('supports interleaved exclude patterns', (done: MochaDone) => { + it('supports interleaved exclude patterns', (done) => { this.timeout(1000); let list: string[] = [ @@ -144,7 +144,7 @@ describe('Match Tests', function () { done(); }); - it('applies default options', (done: MochaDone) => { + it('applies default options', (done) => { this.timeout(1000); let list: string[] = [ @@ -200,7 +200,7 @@ describe('Match Tests', function () { done(); }); - it('trims patterns', (done: MochaDone) => { + it('trims patterns', (done) => { this.timeout(1000); let list: string[] = [ @@ -219,7 +219,7 @@ describe('Match Tests', function () { done(); }); - it('skips empty patterns', (done: MochaDone) => { + it('skips empty patterns', (done) => { this.timeout(1000); let list: string[] = [ @@ -241,7 +241,7 @@ describe('Match Tests', function () { done(); }); - it('supports nocomment true', (done: MochaDone) => { + it('supports nocomment true', (done) => { this.timeout(1000); let list: string[] = [ @@ -260,7 +260,7 @@ describe('Match Tests', function () { done(); }); - it('supports nonegate true', (done: MochaDone) => { + it('supports nonegate true', (done) => { this.timeout(1000); let list: string[] = [ @@ -279,7 +279,7 @@ describe('Match Tests', function () { done(); }); - it('supports flipNegate true', (done: MochaDone) => { + it('supports flipNegate true', (done) => { this.timeout(1000); let list: string[] = [ @@ -298,7 +298,7 @@ describe('Match Tests', function () { done(); }); - it('counts leading negate markers', (done: MochaDone) => { + it('counts leading negate markers', (done) => { this.timeout(1000); let list: string[] = [ @@ -327,7 +327,7 @@ describe('Match Tests', function () { done(); }); - it('trims whitespace after trimming negate markers', (done: MochaDone) => { + it('trims whitespace after trimming negate markers', (done) => { this.timeout(1000); let list: string[] = [ @@ -347,7 +347,7 @@ describe('Match Tests', function () { done(); }); - it('evaluates comments before negation', (done: MochaDone) => { + it('evaluates comments before negation', (done) => { this.timeout(1000); let list: string[] = [ @@ -369,7 +369,7 @@ describe('Match Tests', function () { done(); }); - it('applies pattern root for include patterns', (done: MochaDone) => { + it('applies pattern root for include patterns', (done) => { this.timeout(1000); let list: string[] = [ @@ -394,7 +394,7 @@ describe('Match Tests', function () { done(); }); - it('applies pattern root for exclude patterns', (done: MochaDone) => { + it('applies pattern root for exclude patterns', (done) => { this.timeout(1000); let list: string[] = [ @@ -421,7 +421,7 @@ describe('Match Tests', function () { done(); }); - it('does not apply pattern root for basename matchBase include patterns', (done: MochaDone) => { + it('does not apply pattern root for basename matchBase include patterns', (done) => { this.timeout(1000); let list: string[] = [ @@ -448,7 +448,7 @@ describe('Match Tests', function () { done(); }); - it('does not apply pattern root for basename matchBase exclude patterns', (done: MochaDone) => { + it('does not apply pattern root for basename matchBase exclude patterns', (done) => { this.timeout(1000); let list: string[] = [ diff --git a/node/test/mocktests.ts b/node/test/mocktests.ts index a6cef55a1..6c8e44095 100644 --- a/node/test/mocktests.ts +++ b/node/test/mocktests.ts @@ -162,13 +162,13 @@ describe('Mock Tests', function () { done(); }) - it('Mock loc returns key', (done: MochaDone) => { + it('Mock loc returns key', (done) => { let actual = mt.loc('STR_KEY'); assert.equal(actual, 'loc_mock_STR_KEY'); done(); }) - it('Mock loc returns key and args', (done: MochaDone) => { + it('Mock loc returns key and args', (done) => { let actual = mt.loc('STR_KEY', false, 2, 'three'); assert.equal(actual, 'loc_mock_STR_KEY false 2 three'); done(); @@ -318,13 +318,13 @@ describe('Mock Tests', function () { done(); }) - it('MockTest handles node 14 tasks correctly', function (done) { + it('MockTest handles node 16 tasks correctly', function (done) { this.timeout(30000); - const runner = new mtm.MockTestRunner(path.join(__dirname, 'fakeTasks', 'node14task', 'entry.js')); + const runner = new mtm.MockTestRunner(path.join(__dirname, 'fakeTasks', 'node16task', 'entry.js')); const nodePath = runner.nodePath; assert(nodePath, 'node path should have been correctly set'); const version = ncp.execSync(nodePath + ' -v').toString().trim(); - assert(semver.satisfies(version, '14.x'), 'Downloaded node version should be Node 14 instead of ' + version); + assert(semver.satisfies(version, '16.x'), 'Downloaded node version should be Node 16 instead of ' + version); done(); }) }); diff --git a/node/test/retrytests.ts b/node/test/retrytests.ts index 3f4831b13..bedd68d1a 100644 --- a/node/test/retrytests.ts +++ b/node/test/retrytests.ts @@ -19,7 +19,7 @@ describe('Retry Tests', function () { after(function () { }); - it('retries to execute a function', (done: MochaDone) => { + it('retries to execute a function', (done) => { this.timeout(1000); const testError = Error('Test Error'); diff --git a/node/test/toolrunnertests.ts b/node/test/toolrunnertests.ts index d6d2f6850..e54ccce30 100644 --- a/node/test/toolrunnertests.ts +++ b/node/test/toolrunnertests.ts @@ -1378,8 +1378,12 @@ describe('Toolrunner Tests', function () { // validate stdout assert.equal( output.trim(), - "args[0]: 'myarg1'\r\n" - + "args[1]: 'myarg2'"); + "args[0]: 'args'\r\n" + + "args[1]: 'exe'\r\n" + + "args[2]: 'with'\r\n" + + "args[3]: 'spaces.exe'\r\n" + + "args[4]: 'myarg1'\r\n" + + "args[5]: 'myarg2'"); done(); }) .fail(function (err) { @@ -1641,8 +1645,12 @@ describe('Toolrunner Tests', function () { // validate stdout assert.equal( result.stdout.trim(), - "args[0]: 'myarg1'\r\n" - + "args[1]: 'myarg2'"); + "args[0]: 'args'\r\n" + + "args[1]: 'exe'\r\n" + + "args[2]: 'with'\r\n" + + "args[3]: 'spaces.exe'\r\n" + + "args[4]: 'myarg1'\r\n" + + "args[5]: 'myarg2'") done(); }); diff --git a/node/toolrunner.ts b/node/toolrunner.ts index 843dfe2b7..8e0607c7b 100644 --- a/node/toolrunner.ts +++ b/node/toolrunner.ts @@ -594,6 +594,7 @@ export class ToolRunner extends events.EventEmitter { private _getSpawnSyncOptions(options: IExecSyncOptions): child.SpawnSyncOptions { let result = {}; + result.maxBuffer = 1024 * 1024 * 1024; result.cwd = options.cwd; result.env = options.env; result.shell = options.shell; diff --git a/node/vault.ts b/node/vault.ts index f0a39534a..f5c8bdf80 100644 --- a/node/vault.ts +++ b/node/vault.ts @@ -67,7 +67,7 @@ export class Vault { var encryptedText = ivDataBuffer.slice(16); var decipher = crypto.createDecipheriv(algorithm, key, iv); - var dec = decipher.update(encryptedText,encryptEncoding,unencryptedEncoding); + var dec = decipher.update(encryptedText); var decFinal = decipher.final(unencryptedEncoding); secret = dec + decFinal; diff --git a/tasks.schema.json b/tasks.schema.json index 414d4157b..08dcde4d4 100644 --- a/tasks.schema.json +++ b/tasks.schema.json @@ -385,6 +385,9 @@ "additionalProperties": false, "description": "Execution options for this task (on Pre-Job stage)", "properties": { + "Node16": { + "$ref": "#/definitions/executionObject" + }, "Node10": { "$ref": "#/definitions/executionObject" }, @@ -404,6 +407,9 @@ "additionalProperties": false, "description": "Execution options for this task", "properties": { + "Node16": { + "$ref": "#/definitions/executionObject" + }, "Node10": { "$ref": "#/definitions/executionObject" }, @@ -423,6 +429,9 @@ "additionalProperties": false, "description": "Execution options for this task (on Post-Job stage)", "properties": { + "Node16": { + "$ref": "#/definitions/executionObject" + }, "Node10": { "$ref": "#/definitions/executionObject" },