Skip to content

Commit

Permalink
fix(karma): pass --node_options to karma
Browse files Browse the repository at this point in the history
This enables debugging karma tests with --node_options=--inspect-brk
  • Loading branch information
gregmagolan committed Jan 4, 2020
1 parent a3b39ab commit d48f237
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion packages/karma/src/karma_web_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,24 @@ if [[ ! -z "${{TEST_TMPDIR}}" && ! -n "${{BUILD_WORKSPACE_DIRECTORY}}" ]]; then
ARGV+=( "--single-run" )
fi
$KARMA ${{ARGV[@]}}
# Pass --node_options from args on karma node process
NODE_OPTIONS=()
for ARG in "$@"; do
case "$ARG" in
--node_options=*) NODE_OPTIONS+=( "${{ARG}}" ) ;;
esac
done
KARMA_VERSION=$(${{KARMA}} --version)
printf "\n\n\n\nRunning karma tests\n-----------------------------------------------------------------------------\n"
echo "version :" ${{KARMA_VERSION#Karma version: }}
echo "pwd :" ${{PWD}}
echo "conf :" ${{CONF}}
echo "node_options:" ${{NODE_OPTIONS[@]}}
printf "\n"
${{KARMA}} ${{ARGV[@]}} ${{NODE_OPTIONS[@]}}
""".format(
TMPL_workspace = ctx.workspace_name,
TMPL_karma = _to_manifest_path(ctx, ctx.executable.karma),
Expand Down

0 comments on commit d48f237

Please sign in to comment.