Skip to content

Commit

Permalink
fix: env is valid for js_test and js_run_binary
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed Apr 5, 2023
1 parent 7586f37 commit 9f44242
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions jest/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,15 @@ def jest_test(
if update_snapshots_mode:
gen_snapshots_bin = "{}_ref_snapshots_bin".format(name)

# Filter out named params that only apply to *_test rules.
# Filter out named params that are valid for jest_test but not for jest_binary
bin_kwargs = {
key: val
for key, val in kwargs.items()
# List from https://bazel.build/reference/be/common-definitions#common-attributes-tests
if key not in ["flaky", "shard_count", "local", "env", "env_inherit"]
# Subset of list from https://bazel.build/reference/be/common-definitions#common-attributes-tests
# - "env" is supported by *_binary rules so not filtered out
# - "args" are supported by *_binary rules so not filtered out
# - "size", "timeout" are explicit parameters to the macro so not in kwargs
if key not in ["env_inherit", "flaky", "shard_count", "local"]
}

# This is the generated reference snapshot generator binary target that is used as the
Expand Down

0 comments on commit 9f44242

Please sign in to comment.