2019-05-04 09:45:53 +02:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
load shared-functions
|
|
|
|
|
|
|
|
|
|
|
|
function setup() {
|
|
|
|
unset_n_env
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@test "n --lts" {
|
|
|
|
run n --lts
|
|
|
|
[ "${status}" -eq 0 ]
|
|
|
|
local expected_version
|
|
|
|
expected_version="$(display_remote_version lts)"
|
|
|
|
expected_version="${expected_version#v}"
|
|
|
|
[ "${output}" = "${expected_version}" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-08-04 06:33:45 +02:00
|
|
|
@test "n --stable" {
|
|
|
|
run n --stable
|
|
|
|
[ "${status}" -eq 0 ]
|
|
|
|
local expected_version
|
|
|
|
expected_version="$(display_remote_version lts)"
|
|
|
|
expected_version="${expected_version#v}"
|
|
|
|
[ "${output}" = "${expected_version}" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-05-04 09:45:53 +02:00
|
|
|
@test "n --latest" {
|
|
|
|
run n --latest
|
|
|
|
[ "${status}" -eq 0 ]
|
|
|
|
local expected_version
|
|
|
|
expected_version="$(display_remote_version latest)"
|
|
|
|
expected_version="${expected_version#v}"
|
|
|
|
[ "${output}" = "${expected_version}" ]
|
|
|
|
}
|