Skip to content

Commit 04f8fa5

Browse files
committed
Make it easier to override Behat format
Only set `--format progress` if not already provided via CLI. Improves cross-OS compatibility
1 parent 1883ea9 commit 04f8fa5

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

bin/run-behat-tests

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,16 @@ if [[ "${WP_CLI_TEST_COVERAGE}" == "true" ]] && vendor/bin/behat --help 2>/dev/n
134134
fi
135135

136136
# Run the functional tests.
137-
vendor/bin/behat --snippets-for="WP_CLI\Tests\Context\FeatureContext" --format progress "$BEHAT_TAGS" --strict "${BEHAT_EXTRA_ARGS[@]}" "$@"
137+
FORMAT_SPECIFIED=false
138+
for arg in "$@"; do
139+
if [[ "$arg" == "--format"* ]]; then
140+
FORMAT_SPECIFIED=true
141+
break
142+
fi
143+
done
144+
145+
if [ "$FORMAT_SPECIFIED" = true ]; then
146+
vendor/bin/behat --snippets-for="WP_CLI\Tests\Context\FeatureContext" "$BEHAT_TAGS" --strict "${BEHAT_EXTRA_ARGS[@]}" "$@"
147+
else
148+
vendor/bin/behat --snippets-for="WP_CLI\Tests\Context\FeatureContext" --format progress "$BEHAT_TAGS" --strict "${BEHAT_EXTRA_ARGS[@]}" "$@"
149+
fi

0 commit comments

Comments
 (0)