Skip to content

Commit 9864b6c

Browse files
authored
Migrated 6 tasks to Node20 (#19133)
* Migrated 6 tasks
1 parent bb29926 commit 9864b6c

File tree

372 files changed

+37216
-40
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

372 files changed

+37216
-40
lines changed

Tasks/CondaEnvironmentV0/Tests/L0_conda.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,20 @@ it('fails if `conda` is not found', async function () {
120120
updateConda: false
121121
};
122122

123+
#if NODE20
124+
let error: any | undefined;
125+
#endif
123126
try {
124127
await uut.condaEnvironment(parameters, Platform.Windows);
125128

126129
throw new Error('should not have succeeded');
127130
} catch (e) {
131+
#if NODE20
132+
error = e;
133+
assert.strictEqual(error.message, 'loc_mock_CondaNotFound');
134+
#else
128135
assert.strictEqual(e.message, 'loc_mock_CondaNotFound');
136+
#endif
129137
assert(findConda.calledOnceWithExactly(Platform.Windows));
130138
assert(prependCondaToPath.notCalled);
131139
assert(createEnvironment.notCalled);

Tasks/CondaEnvironmentV0/Tests/L0_conda_internal.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,19 @@ it('creates Conda environment', async function () {
157157
}
158158
});
159159

160+
#if NODE20
161+
let error: any | undefined;
162+
#endif
160163
try {
161164
await uut.createEnvironment(path.join('envsDir', 'env'));
162165
throw new Error('should not have succeeded');
163166
} catch (e) {
167+
#if NODE20
168+
error = e;
169+
assert.strictEqual(error.message, `loc_mock_CreateFailed ${path.join('envsDir', 'env')} Error: conda failed with return code: 1`);
170+
#else
164171
assert.strictEqual(e.message, `loc_mock_CreateFailed ${path.join('envsDir', 'env')} Error: conda failed with return code: 1`);
172+
#endif
165173
}
166174
}
167175
});

Tasks/CondaEnvironmentV0/_buildConfigs/Node20/Tests/package-lock.json

Lines changed: 129 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "conda-environment",
3+
"version": "1.0.0",
4+
"description": "Activate a Conda environment.",
5+
"main": "conda.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/Microsoft/azure-pipelines-tasks.git"
12+
},
13+
"author": "Microsoft Corporation",
14+
"license": "MIT",
15+
"bugs": {
16+
"url": "https://github.com/Microsoft/azure-pipelines-tasks/issues"
17+
},
18+
"homepage": "https://github.com/Microsoft/azure-pipelines-tasks#readme",
19+
"devDependencies": {
20+
"@types/mocha": "^5.2.0",
21+
"@types/sinon": "^4.3.1",
22+
"sinon": "^4.5.0"
23+
}
24+
}

0 commit comments

Comments
 (0)