test: add more tests
This commit is contained in:
@@ -93,3 +93,27 @@ sh_test(
|
||||
args = ["$(location :runtime_flag_bin)"],
|
||||
data = [":runtime_flag_bin"],
|
||||
)
|
||||
|
||||
bun_binary(
|
||||
name = "configured_launcher_bin",
|
||||
entry_point = "hello.ts",
|
||||
node_modules = "@script_test_vite_node_modules//:node_modules",
|
||||
smol = True,
|
||||
conditions = [
|
||||
"browser",
|
||||
"development",
|
||||
],
|
||||
install_mode = "force",
|
||||
run_flags = [
|
||||
"--hot",
|
||||
"--console-depth",
|
||||
"4",
|
||||
],
|
||||
)
|
||||
|
||||
sh_test(
|
||||
name = "bun_binary_configured_launcher_shape_test",
|
||||
srcs = ["verify_configured_launcher_shape.sh"],
|
||||
args = ["$(location :configured_launcher_bin)"],
|
||||
data = [":configured_launcher_bin"],
|
||||
)
|
||||
|
||||
16
tests/binary_test/verify_configured_launcher_shape.sh
Executable file
16
tests/binary_test/verify_configured_launcher_shape.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
binary="$1"
|
||||
|
||||
grep -Fq -- 'install_metadata="${runfiles_dir}/_main/' "${binary}"
|
||||
grep -Fq -- 'node_modules/.rules_bun/install.json' "${binary}"
|
||||
grep -Fq -- "--smol" "${binary}"
|
||||
grep -Fq -- "--conditions" "${binary}"
|
||||
grep -Fq -- "'browser'" "${binary}"
|
||||
grep -Fq -- "'development'" "${binary}"
|
||||
grep -Fq -- "--install" "${binary}"
|
||||
grep -Fq -- "'force'" "${binary}"
|
||||
grep -Fq -- "'--hot'" "${binary}"
|
||||
grep -Fq -- "'--console-depth'" "${binary}"
|
||||
grep -Fq -- "'4'" "${binary}"
|
||||
@@ -4,6 +4,6 @@ set -euo pipefail
|
||||
rule_file="$1"
|
||||
build_file="$2"
|
||||
|
||||
grep -Eq 'files = \[bun_bin, entry_point\] \+ ctx\.files\.data' "${rule_file}"
|
||||
grep -Eq 'extra_files = ctx\.files\.data \+ ctx\.files\.preload \+ ctx\.files\.env_files \+ \[bun_bin\]' "${rule_file}"
|
||||
grep -Eq 'name = "hello_js_with_data_bin"' "${build_file}"
|
||||
grep -Eq 'data = \["payload\.txt"\]' "${build_file}"
|
||||
|
||||
Reference in New Issue
Block a user