Skip to content
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

Test failure due to hard dependency path it test_helper.bash #34

Closed
flickerfly opened this issue Mar 4, 2021 · 2 comments
Closed

Test failure due to hard dependency path it test_helper.bash #34

flickerfly opened this issue Mar 4, 2021 · 2 comments

Comments

@flickerfly
Copy link

When trying to test the bats-assert module, I was getting this error:
bats: /opt/bats-helpers/bats-assert/test/../node_modules/bats-support/load.bash does not exist
I resolved it with
sed -i 's/node_modules/../g' /opt/bats-helpers/bats-assert/test/test_helper.bash

This appears to be managed by bats-support and bats-files test_helper.bash scripts with a bit more flexibility that can probably be nearly copy and pasted.

@hyperupcall
Copy link

For anyone else with this issue, it is also solvable by doing

cd /path/to/bats-support
yarn link # can also do 'npm link'


cd /path/to/bats-assert
yarn link bats-support # can also do `npm link bats-support`

This allows the dependency to 'install' (symlink) properly

gioele added a commit to gioele/bats-assert that referenced this issue Oct 11, 2022
Instead of hard-coding `node_modules` in the path (source of various
issues: bats-core#38, bats-core#34), use the `bats_load_library` command to load
`bats-support`.

`bats_load_library` is available since Bats v1.6.
@martin-schulze-vireso
Copy link
Member

Fixed via #49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants