Skip to content

Commit a3b39ab

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

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

packages/protractor/src/protractor_web_test.bzl

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,24 @@ fi
125125
126126
export HOME=$(mktemp -d)
127127
128-
# Print the protractor version in the test log
129-
PROTRACTOR_VERSION=$($PROTRACTOR --version)
130-
echo "Protractor $PROTRACTOR_VERSION"
131-
132-
# Run the protractor binary
133-
$PROTRACTOR $CONF
128+
# Pass --node_options from args on protractor node process
129+
NODE_OPTIONS=()
130+
for ARG in "$@"; do
131+
case "$ARG" in
132+
--node_options=*) NODE_OPTIONS+=( "${{ARG}}" ) ;;
133+
esac
134+
done
135+
136+
PROTRACTOR_VERSION=$(${{PROTRACTOR}} --version)
137+
138+
printf "\n\n\n\nRunning protractor tests\n-----------------------------------------------------------------------------\n"
139+
echo "version :" ${{PROTRACTOR_VERSION#Version }}
140+
echo "pwd :" ${{PWD}}
141+
echo "conf :" ${{CONF}}
142+
echo "node_options:" ${{NODE_OPTIONS[@]}}
143+
printf "\n"
144+
145+
${{PROTRACTOR}} ${{CONF}} "${{NODE_OPTIONS[@]}}"
134146
""".format(
135147
TMPL_protractor = _to_manifest_path(ctx, ctx.executable.protractor),
136148
TMPL_conf = _to_manifest_path(ctx, configuration),

0 commit comments

Comments
 (0)