Skip to content

Commit

Permalink
fix(builtin): pass kwargs from node_repositories helper
Browse files Browse the repository at this point in the history
We were missing test coverage for attributes like node_version being passed to the new toolchain registration
  • Loading branch information
alexeagle committed Jan 26, 2022
1 parent 25b83d5 commit 4a831de
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions e2e/nodejs_host/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ nodejs_test(
"@nodejs_host//:npm_bin",
"@nodejs_host//:npm_files",
"@nodejs_host//:npx_bin",
"@npm//:node_modules",
"@yarn",
"@yarn//:yarn_bin",
"@yarn//:yarn_files",
Expand Down
6 changes: 5 additions & 1 deletion e2e/nodejs_host/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_d

build_bazel_rules_nodejs_dependencies()

load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install")

node_repositories(
node_version = "12.12.0",
)

yarn_install(
name = "npm",
Expand Down
1 change: 1 addition & 0 deletions e2e/nodejs_host/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"dependencies": {},
"scripts": {
"postinstall": "node -e 'require(\"assert\").equal(process.version, \"v12.12.0\")'",
"test": "bazel test ..."
}
}
2 changes: 1 addition & 1 deletion internal/node/node_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ def node_repositories(**kwargs):
)

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

0 comments on commit 4a831de

Please sign in to comment.