bats-core / bats-assert

Common assertions for Bats
Creative Commons Zero v1.0 Universal
94 stars 39 forks source link

output: parameter not set #46

Closed jmreicha closed 2 years ago

jmreicha commented 2 years ago

I am receiving the following error on a test I have created.

/Users/jreichardt/.nvm/versions/node/v14.17.6/lib/node_modules/bats-assert/src/assert_success.bash: line 33: output: parameter not set

Here is my test:

#!/usr/bin/env bats

load '/Users/jreichardt/.nvm/versions/node/v14.17.6/lib/node_modules/bats-support/load'
load '/Users/jreichardt/.nvm/versions/node/v14.17.6/lib/node_modules/bats-assert/load'

@test "npm" {
    npm version
    assert_success
}

Not sure what the deal is here, from what I see according to the documentation I should be able to do this? Hoping I'm looking over something simple here but this test worked in the older (ztombol/bats-assert) version. It seems that this behavior has changed slightly?

jmreicha commented 2 years ago

FWIW I am able to get the test working when I wrap the command with run bash -c "npm version". I'm guessing this behavior is by design?

jmreicha commented 2 years ago

Yep in the docs https://bats-core.readthedocs.io/en/stable/writing-tests.html#run-test-other-commands

Sorry for the false alarm.