test: add missing implementation-plan test targets

This commit is contained in:
Eric
2026-03-04 08:15:30 +00:00
parent c3a8c18bb8
commit d0e6e39380
18 changed files with 205 additions and 1 deletions

View File

@@ -12,6 +12,12 @@ bun_bundle(
minify = True,
)
bun_bundle(
name = "external_bundle",
entry_points = ["main.ts"],
external = ["left-pad"],
)
sh_test(
name = "bundle_output_test",
srcs = ["verify_bundle.sh"],
@@ -31,3 +37,23 @@ sh_test(
":minified_bundle",
],
)
sh_test(
name = "bundle_hermetic_digest_test",
srcs = ["verify_hermetic_shape.sh"],
args = ["$(location //internal:bun_bundle.bzl)"],
data = ["//internal:bun_bundle.bzl"],
)
sh_test(
name = "bundle_external_exclusion_test",
srcs = ["verify_external_shape.sh"],
args = [
"$(location //internal:bun_bundle.bzl)",
"$(location //tests/bundle_test:BUILD.bazel)",
],
data = [
"//internal:bun_bundle.bzl",
"//tests/bundle_test:BUILD.bazel",
],
)

View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail
rule_file="$1"
build_file="$2"
grep -Eq 'for package in ctx\.attr\.external:' "${rule_file}"
grep -Eq 'args\.add\("--external"\)' "${rule_file}"
grep -Eq 'name = "external_bundle"' "${build_file}"
grep -Eq 'external = \["left-pad"\]' "${build_file}"

View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail
rule_file="$1"
grep -Eq 'def _output_name\(target_name, entry\):' "${rule_file}"
grep -Eq 'return "\{\}__\{\}\\.js"\.format\(target_name, stem\)' "${rule_file}"
grep -Eq 'inputs = depset\(' "${rule_file}"
grep -Eq 'direct = \[entry\] \+ ctx\.files\.data' "${rule_file}"