Skip to content

Commit b446fa1

Browse files
authored
fix(builtin): pass kwargs from node_repositories helper (#3287)
We were missing test coverage for attributes like node_version being passed to the new toolchain registration
1 parent 25b83d5 commit b446fa1

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

e2e/nodejs_host/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ nodejs_test(
1414
"@nodejs_host//:npm_bin",
1515
"@nodejs_host//:npm_files",
1616
"@nodejs_host//:npx_bin",
17+
"@npm//:node_modules",
1718
"@yarn",
1819
"@yarn//:yarn_bin",
1920
"@yarn//:yarn_files",

e2e/nodejs_host/WORKSPACE

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_d
1212

1313
build_bazel_rules_nodejs_dependencies()
1414

15-
load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")
15+
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install")
16+
17+
node_repositories(
18+
node_version = "12.12.0",
19+
)
1620

1721
yarn_install(
1822
name = "npm",

e2e/nodejs_host/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"dependencies": {},
33
"scripts": {
4+
"postinstall": "node -e \"require('assert').equal(process.version, 'v12.12.0')\"",
45
"test": "bazel test ..."
56
}
67
}

internal/node/node_repositories.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ def node_repositories(**kwargs):
4747
)
4848

4949
# Install new toolchain under "nodejs" repository name prefix
50-
nodejs_register_toolchains(name = "nodejs")
50+
nodejs_register_toolchains(name = "nodejs", **kwargs)

0 commit comments

Comments
 (0)