-
-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bats fails to run #127
Comments
I figured out what is happening. Using git bash on Windows 10, so it is bash WIndows issue. I peeked into value of BATS_LIBEXEC set in bats script and added to PATH: BATS_LIBEXEC="$(dirname "$(bats_readlinkf "${BASH_SOURCE[0]}")")"
export BATS_LIBEXEC
...
export PATH="$BATS_LIBEXEC;$PATH;."
...
# Added for debug of https://github.com/plasticrake/tplink-smarthome-api/issues/127
echo "BATS_LEBEXEC=$BATS_LIBEXEC" BATS_LIBEXEC=C:/.../node_modules/bats/libexec/bats-core When I run in bash: export BATS_LIBEXEC=C:/.../node_modules/bats/libexec/bats-core
which bats-exec-suite It gets an error: which: no bats-exec-suite in (C:/.../node_modules/bats/libexec/bats-core: Changing Windows-specific "C:/..." to bash-accepted form "/c/...": export BATS_LIBEXEC=/c/.../node_modules/bats/libexec/bats-core
which bats-exec-suite It gets no error: /c/.../node_modules/bats/libexec/bats-core: So in summary, bash on windows |
The following fix makes bats run ok: file node_modules/bats/libexec/bats-core/bats - BATS_LIBEXEC="$(dirname "$(bats_readlinkf "${BASH_SOURCE[0]}")")"
+ BATS_LIBEXEC="$(cd "$(dirname "$(bats_readlinkf "${BASH_SOURCE[0]}")")"; pwd)" |
Posted issue and solution to Closing here. |
There are issues in bats:
output:
.../node_modules/bats/libexec/bats-core/bats: line 234: exec: bats-exec-suite: not found .../node_modules/bats/libexec/bats-core/bats: line 234: bats-format-pretty: command not found
Trying to add '$BATS_ROOT/libexec/bats-core/' before each offending file resolves the errors, but there are few more such bare invocations across other files that fail the same. Adding the fix to each of them allows bats command to pass.
Environment:
Windows 10
bash for git: GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)
I suspect that setting up PATH variable could fix it (add resolved $BATS_ROOT/libexec/bats-core/), but it is not the right fix.
The text was updated successfully, but these errors were encountered: