Skip to content

Commit d48f237

Browse files
committed
fix(karma): pass --node_options to karma
This enables debugging karma tests with --node_options=--inspect-brk
1 parent a3b39ab commit d48f237

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

packages/karma/src/karma_web_test.bzl

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,24 @@ if [[ ! -z "${{TEST_TMPDIR}}" && ! -n "${{BUILD_WORKSPACE_DIRECTORY}}" ]]; then
268268
ARGV+=( "--single-run" )
269269
fi
270270
271-
$KARMA ${{ARGV[@]}}
271+
# Pass --node_options from args on karma node process
272+
NODE_OPTIONS=()
273+
for ARG in "$@"; do
274+
case "$ARG" in
275+
--node_options=*) NODE_OPTIONS+=( "${{ARG}}" ) ;;
276+
esac
277+
done
278+
279+
KARMA_VERSION=$(${{KARMA}} --version)
280+
281+
printf "\n\n\n\nRunning karma tests\n-----------------------------------------------------------------------------\n"
282+
echo "version :" ${{KARMA_VERSION#Karma version: }}
283+
echo "pwd :" ${{PWD}}
284+
echo "conf :" ${{CONF}}
285+
echo "node_options:" ${{NODE_OPTIONS[@]}}
286+
printf "\n"
287+
288+
${{KARMA}} ${{ARGV[@]}} ${{NODE_OPTIONS[@]}}
272289
""".format(
273290
TMPL_workspace = ctx.workspace_name,
274291
TMPL_karma = _to_manifest_path(ctx, ctx.executable.karma),

0 commit comments

Comments
 (0)