blob: e3322dedab1db8aa734903af6d675a476fff4fcc [file]
load("@build_bazel_rules_nodejs//:index.bzl", "generated_file_test", "nodejs_binary")
load("//internal/providers/test:run_node_test.bzl", "js_write_file")
# two nodejs_binary targets provide two separate executables in the run_node test
nodejs_binary(
name = "writer_bin",
entry_point = "js-write-file.js",
)
nodejs_binary(
name = "writer_bin2",
data = [
# the JS files doesn't actually consume this dependency, but it causes a different modules
# manifest file to be written in for both run_node actions in the js_write_file rule below
"@npm//shelljs",
],
entry_point = "js-write-file.js",
)
nodejs_binary(
name = "cloner_bin",
entry_point = "js-clone-file.js",
)
js_write_file(
name = "write_file",
content = "test file content",
)
# tests that the rule above generated two files for each run_node action
[
generated_file_test(
name = "run_node_test_%s" % file,
src = "_run_node_out.txt",
generated = "%s.txt" % file,
)
for file in [
"out",
"out2",
"out3",
"out4",
]
]