2
2
3
3
load ("@build_bazel_rules_nodejs//internal/node:node.bzl" , "nodejs_binary" , "nodejs_test" )
4
4
5
- def generated_file_test (name , generated , src , substring_search = False , src_dbg = None , ** kwargs ):
5
+ def generated_file_test (name , generated , src , substring_search = False , src_dbg = None , visibility = None , ** kwargs ):
6
6
"""Tests that a file generated by Bazel has identical content to a file in the workspace.
7
7
8
8
This is useful for testing, where a "snapshot" or "golden" file is checked in,
@@ -16,6 +16,7 @@ def generated_file_test(name, generated, src, substring_search = False, src_dbg
16
16
anywhere within the generated file. Note that the .update rule is not generated in substring mode.
17
17
src_dbg: if the build uses `--compilation_mode dbg` then some rules will produce different output.
18
18
In this case you can specify what the dbg version of the output should look like
19
+ visibility: visibility for both test target & update target
19
20
**kwargs: extra arguments passed to the underlying nodejs_test
20
21
"""
21
22
data = [src , generated ]
@@ -36,6 +37,7 @@ def generated_file_test(name, generated, src, substring_search = False, src_dbg
36
37
loc % generated ,
37
38
],
38
39
data = data ,
40
+ visibility = visibility ,
39
41
** kwargs
40
42
)
41
43
@@ -46,4 +48,5 @@ def generated_file_test(name, generated, src, substring_search = False, src_dbg
46
48
entry_point = "@build_bazel_rules_nodejs//internal/generated_file_test:bundle.js" ,
47
49
templated_args = ["--out" , loc % src , loc % src_dbg , loc % generated ],
48
50
data = data ,
51
+ visibility = visibility ,
49
52
)
0 commit comments