Skip to content

Commit 985798c

Browse files
committed
fix(env): add --skip-env-file to tests where .env clobbers env vars
The .env file sourcing overwrites BASHUNIT_BOOTSTRAP_ARGS and BASHUNIT_NO_COLOR set by the test environment or early flag scan.
1 parent 314c79f commit 985798c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

tests/acceptance/bashunit_bootstrap_args_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function test_bootstrap_args_via_env_variable() {
2626
# Use --env flag to set the bootstrap file (avoiding .env override),
2727
# but use BASHUNIT_BOOTSTRAP_ARGS from environment
2828
output=$(BASHUNIT_BOOTSTRAP_ARGS="hello world" \
29-
./bashunit --no-parallel --simple \
29+
./bashunit --no-parallel --simple --skip-env-file \
3030
--env "tests/acceptance/fixtures/bootstrap_with_args.sh" \
3131
tests/acceptance/fixtures/test_bootstrap_args.sh 2>&1) || true
3232

tests/acceptance/bashunit_no_color_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function set_up_before_script() {
88
function test_bashunit_no_color_flag_disables_colors() {
99
local test_file=./tests/acceptance/fixtures/test_bashunit_when_a_test_passes.sh
1010
local output
11-
output=$(./bashunit --no-parallel --env "$TEST_ENV_FILE" "$test_file" --no-color --simple)
11+
output=$(./bashunit --no-parallel --skip-env-file --env "$TEST_ENV_FILE" "$test_file" --no-color --simple)
1212

1313
# ANSI escape codes start with \x1b[ (ESC[) - should not be present
1414
assert_not_contains $'\e[' "$output"

0 commit comments

Comments
 (0)