2019-08-04 06:33:45 +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-08-04 06:33:45 +02:00
|
|
|
|
|
|
|
function setup() {
|
|
|
|
unset_n_env
|
|
|
|
setup_tmp_prefix
|
|
|
|
}
|
|
|
|
|
|
|
|
function teardown() {
|
|
|
|
rm -rf "${TMP_PREFIX_DIR}"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@test "n uninstall (of lts)" {
|
|
|
|
n lts
|
|
|
|
[ -f "${N_PREFIX}/bin/node" ]
|
|
|
|
[ -f "${N_PREFIX}/bin/npm" ]
|
|
|
|
[ -f "${N_PREFIX}/lib/node_modules/npm/package.json" ]
|
|
|
|
|
|
|
|
# Check we get all the files if we uninstall and rm cache.
|
|
|
|
echo y | n uninstall
|
|
|
|
n rm lts
|
2020-12-20 07:10:34 +01:00
|
|
|
output="$(find "${N_PREFIX}" -not -type d)"
|
2020-12-21 10:50:54 +01:00
|
|
|
assert_equal "$output" ""
|
2019-08-04 06:33:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@test "n uninstall (of nightly/latest)" {
|
|
|
|
n nightly/latest
|
|
|
|
[ -f "${N_PREFIX}/bin/node" ]
|
|
|
|
[ -f "${N_PREFIX}/bin/npm" ]
|
|
|
|
[ -f "${N_PREFIX}/lib/node_modules/npm/package.json" ]
|
|
|
|
|
|
|
|
# Check we get all the files if we uninstall and rm cache.
|
|
|
|
echo y | n uninstall
|
|
|
|
n rm nightly/latest
|
2020-12-20 07:10:34 +01:00
|
|
|
output="$(find "${N_PREFIX}" -not -type d)"
|
2020-12-21 10:50:54 +01:00
|
|
|
assert_equal "$output" ""
|
2019-08-04 06:33:45 +02:00
|
|
|
}
|