Skip to content

Commit fb9400c

Browse files
committed
test: improve test output
1 parent aca77bd commit fb9400c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

rewatch/tests/compile.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,21 +87,23 @@ then
8787
fi
8888

8989
file_count=$(find ./packages/with-dev-deps/test -name *.mjs | wc -l)
90-
if [ "$file_count" -eq 1 ];
90+
expected_file_count=1
91+
if [ "$file_count" -eq $expected_file_count ];
9192
then
9293
success "Compiled dev dependencies successfully"
9394
else
94-
error "Expected 2 files to be compiled with the --dev flag, found $file_count"
95+
error "Expected $expected_file_count files to be compiled with the --dev flag, found $file_count"
9596
exit 1
9697
fi
9798

98-
rewatch clean &> /dev/null
99+
error_output=$(rewatch clean 2>&1 >/dev/null)
99100
file_count=$(find ./packages/with-dev-deps -name *.mjs | wc -l)
100101
if [ "$file_count" -eq 0 ];
101102
then
102103
success "Cleaned dev dependencies successfully"
103104
else
104105
error "Expected 0 files remaining after cleaning, found $file_count"
106+
printf "%s\n" "$error_output" >&2
105107
exit 1
106108
fi
107109

0 commit comments

Comments
 (0)