2019-05-04 09:45:53 +02:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
load shared-functions
|
2020-12-21 10:50:54 +01:00
|
|
|
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" {
|
2020-12-20 07:10:34 +01:00
|
|
|
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}"
|
2020-12-21 10:50:54 +01:00
|
|
|
assert_equal "${output}" "${expected_version}"
|
2019-05-04 09:45:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-08-04 06:33:45 +02:00
|
|
|
@test "n --stable" {
|
2020-12-20 07:10:34 +01:00
|
|
|
output="$(n --stable)"
|
2019-08-04 06:33:45 +02:00
|
|
|
local expected_version
|
|
|
|
expected_version="$(display_remote_version lts)"
|
|
|
|
expected_version="${expected_version#v}"
|
2020-12-21 10:50:54 +01:00
|
|
|
assert_equal "${output}" "${expected_version}"
|
2019-08-04 06:33:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-05-04 09:45:53 +02:00
|
|
|
@test "n --latest" {
|
2020-12-20 07:10:34 +01:00
|
|
|
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}"
|
2020-12-21 10:50:54 +01:00
|
|
|
assert_equal "${output}" "${expected_version}"
|
2019-05-04 09:45:53 +02:00
|
|
|
}
|