You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated mock test to support test cases for Node24 in task (#1132)
* Updated mock test to support test cases for Node24 in task
* Changes to add support for Node 24
---------
Co-authored-by: Sanju Yadav <sanjuyadav@microsoft.com>
Azure DevOps is currently working to establish Node 10 as the new preferred runtime for tasks, upgrading from Node 6.
23
-
Relevant work is happening in the `master` branch and the major version should be used with Node 10 is 3.
24
-
Previous major version is stored in the `releases/2.x`
22
+
Azure Pipelines supports multiple Node.js runtimes for task execution:
25
23
26
-
### Upgrading to Node 10
24
+
***Node 6** - Supported
25
+
***Node 10** - Supported
26
+
***Node 16** - Supported
27
+
***Node 20** - Current recommended version
28
+
***Node 24** - Latest version with modern JavaScript features
27
29
28
-
Upgrading your tasks from Node 6 should be relatively painless, however there are some things to note:
29
-
* Typescript has been upgraded to TS 4. Older versions of TS may or may not work with Node 14 or the 3.x branch. We recommend upgrading to TS 4 when upgrading to task-lib 3.x.
30
-
* Node has made some changes to `fs` between Node 6 and Node 10. It is worth reviewing and testing your tasks thoroughly before publishing updates to Node 10.
30
+
### Node Version Selection
31
+
32
+
The Node runtime used depends on the `execution` handler specified in your task's `task.json`:
33
+
*`Node` - Uses Node 6
34
+
*`Node10` - Uses Node 10
35
+
*`Node16` - Uses Node 16
36
+
*`Node20_1` - Uses Node 20 (Note: handler name includes _1 suffix)
37
+
*`Node24` - Uses Node 24
38
+
39
+
### Upgrading to Newer Node Versions
40
+
41
+
When upgrading your tasks to newer Node versions:
42
+
***TypeScript**: Ensure you're using a compatible TypeScript version (TS 4.0+ for Node 10+, TS 5.0+ for Node 20+, TS 5.7+ for Node 24)
43
+
***Dependencies**: Review and update npm dependencies for compatibility with the target Node version
44
+
***Testing**: Thoroughly test your tasks with the new Node runtime before publishing
45
+
***Breaking Changes**: Review Node.js release notes for breaking changes between versions (especially `fs` module changes)
Copy file name to clipboardExpand all lines: node/docs/nodeVersioning.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
3
3
## Agent Node Handler
4
4
5
-
The agent currently has 3 different node handlers that it can use to execute node tasks: Node 6, Node 10, Node 16.
5
+
The agent currently has multiple node handlers that it can use to execute node tasks: Node 6, Node 10, Node 16, Node 20, and Node 24.
6
6
The handler used depends on the `execution` property specified in the tasks `task.json`.
7
-
If the `execution` property is specified to be `Node`, the task will run on the Node 6 handler, for `Node10` it will run on the Node 10 handler, for `Node16` it will run on the Node 16 handler.
7
+
If the `execution` property is specified to be `Node`, the task will run on the Node 6 handler, for `Node10` it will run on the Node 10 handler, for `Node16` it will run on the Node 16 handler, for `Node20_1` it will run on the Node 20 handler, and for `Node24` it will run on the Node 24 handler.
8
8
9
9
## Mock-test Node Handler
10
10
@@ -16,5 +16,5 @@ If this version of node is not found on the path, the library downloads the appr
16
16
17
17
### Behavior overrides
18
18
19
-
To specify a specific version of node to use, set the `nodeVersion` optional parameter in the `run` function of the `MockTestRunner` to the integer major version (e.g. `mtr.run(5)`).
19
+
To specify a specific version of node to use, set the `nodeVersion` optional parameter in the `run` function of the `MockTestRunner` to the integer major version (e.g. `mtr.run(20)` for Node 20, `mtr.run(24)` for Node 24).
20
20
To specify the location of a `task.json` file, set the `taskJsonPath` optional parameter in the `MockTestRunner` constructor to the path of the file (e.g. `let mtr = new mt.MockTaskRunner('<pathToTest>', '<pathToTask.json>'`).
0 commit comments