@@ -181,7 +181,7 @@ js_test(
181181###############################
182182# Use case 4
183183# A first-party library which we want to run as a program.
184- # This relies on @mycorp/pkg-a and @mycorp/pkg-b which are packages within this monorepo.
184+ # This relies on @mycorp/pkg-{a,b,d} which are packages within this monorepo.
185185
186186write_file (
187187 name = "write4_cjs" ,
@@ -212,6 +212,7 @@ write_file(
212212 name = "bin4_%s" % t ,
213213 data = [
214214 ":node_modules/@mycorp/pkg-a" ,
215+ ":node_modules/@mycorp/pkg-e" ,
215216 "//:node_modules/@mycorp/pkg-b" ,
216217 ],
217218 entry_point = "case4.%s" % t ,
@@ -263,6 +264,27 @@ write_file(
263264 file1 = "//examples:expected_one_ast.json" ,
264265 file2 = ":out4-b_%s" % t ,
265266 ),
267+ js_run_binary (
268+ name = "run4-e_%s" % t ,
269+ outs = ["out4-e_%s" % t ],
270+ args = [
271+ "out4-e_%s" % t ,
272+ "@mycorp/pkg-e" ,
273+ ],
274+ chdir = package_name (),
275+ # This specifically tests that a `select` and `|` operator can be used when setting `env`.
276+ env = {} | select ({
277+ "//conditions:default" : {
278+ "NODE_ENV" : "production" ,
279+ },
280+ }),
281+ tool = ":bin4_%s" % t ,
282+ ),
283+ diff_test (
284+ name = "test4-e_%s" % t ,
285+ file1 = "//examples:expected_one_ast.json" ,
286+ file2 = ":out4-e_%s" % t ,
287+ ),
266288 ]
267289 for t in [
268290 "mjs" ,
0 commit comments