Skip to content
Myr

Add slow test to check nvm uninstall with file permission error

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Luke Childs · committed by Luke Childs · parent dff4f80 · Browse files · 1 file+30 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+30 added−0 removed

  • tests:+30 added−0 removed

1 file+30 added−0 removed

added:test/slow/nvm uninstall/Running "nvm uninstall" with incorrect file permissions fails nicely+30 added
1#!/bin/sh23die () { echo $@ ; exit 1; }45# Source nvm6. ../../../nvm.sh78# Version to install/uninstall9NVM_TEST_VERSION=5.10.11011# Make sure it's not already here12[ -e ../../../$NVM_TEST_VERSION ] && rm -R ../../../$NVM_TEST_VERSION1314# Install it15nvm install $NVM_TEST_VERSION1617# Make sure it installed18nvm ls | grep "$NVM_TEST_VERSION" || die "Failed to install node"1920# Install global module as root21npm_path=$(which npm)22sudo "$npm_path" install jspm -g2324# Switch to another version so we can uninstall25nvm use 0.12.72627# Attempt to uninstall it28RETURN_MESSAGE="$(nvm uninstall $NVM_TEST_VERSION 2>&1)"29CHECK_FOR="Cannot uninstall, incorrect permissions on installation folder"30test "${RETURN_MESSAGE#*$CHECK_FOR}" != "$RETURN_MESSAGE" || die "Failed to show error message"