Skip to content

Commit c50f7a5

Browse files
committed
Merge branch 'fix/dx-silent-test-passes'
2 parents 2daf49f + ff105b0 commit c50f7a5

File tree

6 files changed

+16
-12
lines changed

6 files changed

+16
-12
lines changed

tests/unit/assert_basic_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# shellcheck disable=SC2329
55

66
function test_successful_fail() {
7-
true || bashunit::fail "This cannot fail"
7+
assert_empty "$(true || bashunit::fail "This cannot fail")"
88
}
99

1010
function test_unsuccessful_fail() {

tests/unit/env_test.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ function test_env_flag_returns_failure_when_false() {
5555
fi
5656

5757
eval "export $var_name='$original_value'"
58+
assert_successful_code 0
5859
}
5960

6061
function provide_boolean_flags_false() {
@@ -90,6 +91,7 @@ function test_is_dev_mode_disabled_when_dev_log_empty() {
9091
fi
9192

9293
export BASHUNIT_DEV_LOG="$original"
94+
assert_successful_code 0
9395
}
9496

9597
function test_is_tap_output_enabled_when_format_is_tap() {
@@ -113,6 +115,7 @@ function test_is_tap_output_disabled_when_format_is_not_tap() {
113115
fi
114116

115117
export BASHUNIT_OUTPUT_FORMAT="$original"
118+
assert_successful_code 0
116119
}
117120

118121
function test_active_internet_connection_returns_failure_when_no_network() {
@@ -126,6 +129,7 @@ function test_active_internet_connection_returns_failure_when_no_network() {
126129
fi
127130

128131
export BASHUNIT_NO_NETWORK="$original"
132+
assert_successful_code 0
129133
}
130134

131135
function test_find_terminal_width_returns_a_number() {

tests/unit/fixtures/find_total_tests/provider_test.sh renamed to tests/unit/fixtures/find_total_tests/provider_fixture.sh

File renamed without changes.

tests/unit/fixtures/find_total_tests/simple_test.bash renamed to tests/unit/fixtures/find_total_tests/simple_fixture.bash

File renamed without changes.
File renamed without changes.

tests/unit/helpers_test.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -292,39 +292,39 @@ function test_find_total_tests_no_files() {
292292

293293
function test_find_total_tests_simple_file() {
294294
local file
295-
file="$(bashunit::current_dir)/fixtures/find_total_tests/simple_test.sh"
295+
file="$(bashunit::current_dir)/fixtures/find_total_tests/simple_fixture.sh"
296296

297297
assert_same "2" "$(helpers_test::find_total_in_subshell "" "$file")"
298298
}
299299

300300
function test_find_total_tests_simple_file_bash() {
301301
local file
302-
file="$(bashunit::current_dir)/fixtures/find_total_tests/simple_test.bash"
302+
file="$(bashunit::current_dir)/fixtures/find_total_tests/simple_fixture.bash"
303303

304304
assert_same "2" "$(helpers_test::find_total_in_subshell "" "$file")"
305305
}
306306

307307
function test_find_total_tests_with_provider() {
308308
local file
309-
file="$(bashunit::current_dir)/fixtures/find_total_tests/provider_test.sh"
309+
file="$(bashunit::current_dir)/fixtures/find_total_tests/provider_fixture.sh"
310310

311311
assert_same "3" "$(helpers_test::find_total_in_subshell "" "$file")"
312312
}
313313

314314
function test_find_total_tests_multiple_files() {
315315
local file1
316316
local file2
317-
file1="$(bashunit::current_dir)/fixtures/find_total_tests/simple_test.sh"
318-
file2="$(bashunit::current_dir)/fixtures/find_total_tests/provider_test.sh"
317+
file1="$(bashunit::current_dir)/fixtures/find_total_tests/simple_fixture.sh"
318+
file2="$(bashunit::current_dir)/fixtures/find_total_tests/provider_fixture.sh"
319319

320320
assert_same "5" "$(helpers_test::find_total_in_subshell "" "$file1" "$file2")"
321321
}
322322

323323
function test_find_total_tests_with_filter() {
324324
local file1
325325
local file2
326-
file1="$(bashunit::current_dir)/fixtures/find_total_tests/simple_test.sh"
327-
file2="$(bashunit::current_dir)/fixtures/find_total_tests/provider_test.sh"
326+
file1="$(bashunit::current_dir)/fixtures/find_total_tests/simple_fixture.sh"
327+
file2="$(bashunit::current_dir)/fixtures/find_total_tests/provider_fixture.sh"
328328

329329
assert_same "3" "$(helpers_test::find_total_in_subshell "with_provider" "$file1" "$file2")"
330330
}
@@ -387,28 +387,28 @@ function test_parse_file_path_filter_with_colon_in_path() {
387387

388388
function test_find_function_at_line_first_function() {
389389
local file
390-
file="$(bashunit::current_dir)/fixtures/find_total_tests/simple_test.sh"
390+
file="$(bashunit::current_dir)/fixtures/find_total_tests/simple_fixture.sh"
391391

392392
assert_same "test_first" "$(bashunit::helper::find_function_at_line "$file" 4)"
393393
}
394394

395395
function test_find_function_at_line_second_function() {
396396
local file
397-
file="$(bashunit::current_dir)/fixtures/find_total_tests/simple_test.sh"
397+
file="$(bashunit::current_dir)/fixtures/find_total_tests/simple_fixture.sh"
398398

399399
assert_same "test_second" "$(bashunit::helper::find_function_at_line "$file" 8)"
400400
}
401401

402402
function test_find_function_at_line_exact_function_line() {
403403
local file
404-
file="$(bashunit::current_dir)/fixtures/find_total_tests/simple_test.sh"
404+
file="$(bashunit::current_dir)/fixtures/find_total_tests/simple_fixture.sh"
405405

406406
assert_same "test_first" "$(bashunit::helper::find_function_at_line "$file" 3)"
407407
}
408408

409409
function test_find_function_at_line_before_any_function() {
410410
local file
411-
file="$(bashunit::current_dir)/fixtures/find_total_tests/simple_test.sh"
411+
file="$(bashunit::current_dir)/fixtures/find_total_tests/simple_fixture.sh"
412412

413413
assert_same "" "$(bashunit::helper::find_function_at_line "$file" 1)"
414414
}

0 commit comments

Comments
 (0)