Skip to content

Commit 77e508a

Browse files
committed
test: node v24+ toolchains
1 parent b19c329 commit 77e508a

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

e2e/smoke/BUILD.bazel

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,12 @@ write_file(
234234
content = ["v16.5.0"],
235235
)
236236

237+
write_file(
238+
name = "write_node_version_24",
239+
out = "expected_node_24",
240+
content = ["v24.11.1"],
241+
)
242+
237243
# To see what nodejs version is used by default
238244
my_nodejs(
239245
name = "run_no_toolchain",
@@ -312,3 +318,24 @@ diff_test(
312318
file1 = "write_node_version_15",
313319
file2 = "thing_toolchain_15",
314320
)
321+
322+
my_nodejs(
323+
name = "run_24",
324+
out = "thing_toolchain_24",
325+
entry_point = "version.js",
326+
# using the select statement will download toolchains for all three platforms
327+
# you can also just provide an individual toolchain if you don't want to download them all
328+
toolchain = select({
329+
"@bazel_tools//src/conditions:linux_x86_64": "@node24_linux_amd64//:toolchain",
330+
"@bazel_tools//src/conditions:linux_aarch64": "@node24_linux_arm64//:toolchain",
331+
"@bazel_tools//src/conditions:darwin_x86_64": "@node24_darwin_amd64//:toolchain",
332+
"@bazel_tools//src/conditions:darwin_arm64": "@node24_darwin_arm64//:toolchain",
333+
"@bazel_tools//src/conditions:windows": "@node24_windows_amd64//:toolchain",
334+
}),
335+
)
336+
337+
diff_test(
338+
name = "test_node_version_24",
339+
file1 = "write_node_version_24",
340+
file2 = "thing_toolchain_24",
341+
)

e2e/smoke/MODULE.bazel

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ node.toolchain(
2323
node_version = "15.14.0",
2424
)
2525

26+
# Node24 changed some directory structures: https://github.com/bazel-contrib/rules_nodejs/issues/3887
27+
node.toolchain(
28+
name = "node24",
29+
node_version = "24.11.1",
30+
)
31+
2632
# FIXME(6.0): a repo rule with name=foo should create a repo named @foo, not @foo_toolchains
2733
use_repo(
2834
node,
@@ -34,6 +40,11 @@ use_repo(
3440
"node17_linux_amd64",
3541
"node17_linux_arm64",
3642
"node17_windows_amd64",
43+
"node24_darwin_amd64",
44+
"node24_darwin_arm64",
45+
"node24_linux_amd64",
46+
"node24_linux_arm64",
47+
"node24_windows_amd64",
3748
"nodejs_darwin_amd64",
3849
"nodejs_darwin_arm64",
3950
"nodejs_linux_amd64",

e2e/smoke/WORKSPACE.bazel

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ nodejs_register_toolchains(
2525
node_version = "15.14.0",
2626
)
2727

28+
nodejs_register_toolchains(
29+
name = "node24",
30+
node_version = "24.11.1",
31+
)
32+
2833
http_archive(
2934
name = "npm_acorn-8.5.0",
3035
build_file_content = """load("@bazel_lib//lib:copy_directory.bzl", "copy_directory")

0 commit comments

Comments
 (0)