Skip to content

Commit

Permalink
fix(protractor): pass --node_options to protractor
Browse files Browse the repository at this point in the history
This enables debugging protractor tests with --node_options=--inspect-brk
  • Loading branch information
gregmagolan committed Jan 4, 2020
1 parent a2a29e6 commit a3b39ab
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions packages/protractor/src/protractor_web_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,24 @@ fi
export HOME=$(mktemp -d)
# Print the protractor version in the test log
PROTRACTOR_VERSION=$($PROTRACTOR --version)
echo "Protractor $PROTRACTOR_VERSION"
# Run the protractor binary
$PROTRACTOR $CONF
# Pass --node_options from args on protractor node process
NODE_OPTIONS=()
for ARG in "$@"; do
case "$ARG" in
--node_options=*) NODE_OPTIONS+=( "${{ARG}}" ) ;;
esac
done
PROTRACTOR_VERSION=$(${{PROTRACTOR}} --version)
printf "\n\n\n\nRunning protractor tests\n-----------------------------------------------------------------------------\n"
echo "version :" ${{PROTRACTOR_VERSION#Version }}
echo "pwd :" ${{PWD}}
echo "conf :" ${{CONF}}
echo "node_options:" ${{NODE_OPTIONS[@]}}
printf "\n"
${{PROTRACTOR}} ${{CONF}} "${{NODE_OPTIONS[@]}}"
""".format(
TMPL_protractor = _to_manifest_path(ctx, ctx.executable.protractor),
TMPL_conf = _to_manifest_path(ctx, configuration),
Expand Down

0 comments on commit a3b39ab

Please sign in to comment.