0
0
mirror of https://github.com/tj/n.git synced 2024-11-22 11:37:26 +01:00
n/test/tests/lookup.bats

38 lines
818 B
Plaintext
Raw Normal View History

2019-05-04 09:45:53 +02:00
#!/usr/bin/env bats
load shared-functions
load '../../node_modules/bats-support/load'
load '../../node_modules/bats-assert/load'
2019-05-04 09:45:53 +02:00
function setup() {
unset_n_env
}
@test "n --lts" {
output="$(n --lts)"
2019-05-04 09:45:53 +02:00
local expected_version
expected_version="$(display_remote_version lts)"
expected_version="${expected_version#v}"
assert_equal "${output}" "${expected_version}"
2019-05-04 09:45:53 +02:00
}
@test "n --stable" {
output="$(n --stable)"
local expected_version
expected_version="$(display_remote_version lts)"
expected_version="${expected_version#v}"
assert_equal "${output}" "${expected_version}"
}
2019-05-04 09:45:53 +02:00
@test "n --latest" {
output="$(n --latest)"
2019-05-04 09:45:53 +02:00
local expected_version
expected_version="$(display_remote_version latest)"
expected_version="${expected_version#v}"
assert_equal "${output}" "${expected_version}"
2019-05-04 09:45:53 +02:00
}