diff --git a/.travis.yml b/.travis.yml index effbd86..c876ff4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ addons: apt: packages: - zsh +<<<<<<< HEAD # - ksh # - gcc-4.8 # - g++-4.8 @@ -12,6 +13,8 @@ addons: git: submodules: false +======= +>>>>>>> f9670e18a6bec3a93c8e904c96f008704c4e798e cache: ccache: true directories: @@ -31,8 +34,12 @@ before_install: - bash --version | head - zsh --version - dpkg -s dash | grep ^Version | awk '{print $2}' +<<<<<<< HEAD # install python - pyenv local 2.7.18 || pyenv install 2.7.18 +======= + - pyenv install 2.7.18 +>>>>>>> f9670e18a6bec3a93c8e904c96f008704c4e798e - pyenv local 2.7.18 || echo 'pyenv failed' - python -V install: @@ -60,10 +67,6 @@ jobs: dist: xenial - env: SHELL=zsh TEST_SUITE=installation_node WITHOUT_CURL=1 dist: xenial - #- env: SHELL=ksh TEST_SUITE=installation_node - # dist: xenial - #- env: SHELL=ksh TEST_SUITE=installation_node WITHOUT_CURL=1 - # dist: xenial - env: SHELL=bash TEST_SUITE=xenial dist: xenial - env: SHELL=sh TEST_SUITE=xenial @@ -72,8 +75,6 @@ jobs: dist: xenial - env: SHELL=zsh TEST_SUITE=xenial dist: xenial - #- env: SHELL=ksh TEST_SUITE=xenial - # dist: xenial env: global: - CXX=g++ @@ -86,17 +87,14 @@ env: - SHELL=dash TEST_SUITE=fast - SHELL=bash TEST_SUITE=fast - SHELL=zsh TEST_SUITE=fast - # - SHELL=ksh TEST_SUITE=fast - SHELL=sh TEST_SUITE=sourcing - SHELL=dash TEST_SUITE=sourcing - SHELL=bash TEST_SUITE=sourcing - SHELL=zsh TEST_SUITE=sourcing - # - SHELL=ksh TEST_SUITE=sourcing - SHELL=sh TEST_SUITE=slow - SHELL=dash TEST_SUITE=slow - SHELL=bash TEST_SUITE=slow - SHELL=zsh TEST_SUITE=slow - # - SHELL=ksh TEST_SUITE=slow - SHELL=sh TEST_SUITE=installation_iojs - SHELL=sh TEST_SUITE=installation_iojs WITHOUT_CURL=1 - SHELL=dash TEST_SUITE=installation_iojs @@ -104,6 +102,4 @@ env: - SHELL=bash TEST_SUITE=installation_iojs - SHELL=bash TEST_SUITE=installation_iojs WITHOUT_CURL=1 - SHELL=zsh TEST_SUITE=installation_iojs - - SHELL=zsh TEST_SUITE=installation_iojs WITHOUT_CURL=1 - # - SHELL=ksh TEST_SUITE=installation_iojs - # - SHELL=ksh TEST_SUITE=installation_iojs WITHOUT_CURL=1 + - SHELL=zsh TEST_SUITE=installation_iojs WITHOUT_CURL=1 \ No newline at end of file diff --git a/.vscode/__init__.py b/.vscode/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..a0be7d5 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "jianglinghao.vscode-npm-scripts", + "stevenhansel.vscode-nvm", + "vadimcn.vscode-lldb" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..f202a94 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "npm-scripts.showStartNotification": false, + "compile-hero.disable-compile-files-on-did-save-code": false +} diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 84d2f85..929a1b4 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -34,92 +34,3 @@ For more information, refer to the full [Code of Conduct governance document](ht --- -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience -* Focusing on what is best not just for us as individuals, but for the overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [@ljharb](ljharb@gmail.com). -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series of actions. - -**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at -[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. - -Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. - -For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at -[https://www.contributor-covenant.org/translations][translations]. - -[homepage]: https://www.contributor-covenant.org -[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html -[Mozilla CoC]: https://github.com/mozilla/diversity -[FAQ]: https://www.contributor-covenant.org/faq -[translations]: https://www.contributor-covenant.org/translations diff --git a/compose-dev.yaml b/compose-dev.yaml new file mode 100644 index 0000000..cc7fd0a --- /dev/null +++ b/compose-dev.yaml @@ -0,0 +1,12 @@ +services: + app: + entrypoint: + - sleep + - infinity + image: docker/dev-environments-javascript:stable-1 + init: true + volumes: + - type: bind + source: /var/run/docker.sock + target: /var/run/docker.sock + diff --git a/package.json b/package.json index 605ba8a..7e75046 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,12 @@ "eclint": "^2.8.1", "markdown-link-check": "^3.12.2", "replace": "^1.2.2", +<<<<<<< HEAD "semver": "^7.6.3", "urchin": "^0.0.5" +======= + "semver": "^7.5.4", + "urchin": "^2.0.11" +>>>>>>> f9670e18a6bec3a93c8e904c96f008704c4e798e } -} +} \ No newline at end of file diff --git a/test/fast/Aliases/'nvm alias' should ignore leading blank lines in the file b/test/fast/Aliases/'nvm alias' should ignore leading blank lines in the file old mode 100755 new mode 100644 diff --git a/test/fast/Aliases/'nvm alias' should not accept aliases with slashes b/test/fast/Aliases/'nvm alias' should not accept aliases with slashes old mode 100755 new mode 100644 diff --git a/test/fast/Aliases/'nvm unalias' should accept aliases when they shadow a built-in alias b/test/fast/Aliases/'nvm unalias' should accept aliases when they shadow a built-in alias old mode 100755 new mode 100644 diff --git a/test/fast/Aliases/'nvm unalias' should not accept aliases with names equal to built-in alias b/test/fast/Aliases/'nvm unalias' should not accept aliases with names equal to built-in alias old mode 100755 new mode 100644 diff --git a/test/fast/Aliases/'nvm unalias' should not accept aliases with slashes b/test/fast/Aliases/'nvm unalias' should not accept aliases with slashes old mode 100755 new mode 100644 diff --git a/test/fast/Aliases/'nvmalias' should ignore leading blank lines in the file b/test/fast/Aliases/'nvmalias' should ignore leading blank lines in the file new file mode 100644 index 0000000..3fe5784 --- /dev/null +++ b/test/fast/Aliases/'nvmalias' should ignore leading blank lines in the file @@ -0,0 +1,20 @@ +#!/bin/sh + +die() { echo "$@" ; exit 1; } + +export NVM_DIR="$(cd ../../.. && pwd)" + +\. "${NVM_DIR}/nvm.sh" +\. ../../common.sh + +echo " + +v0.0.1 +" > ../../../alias/test-blank-lines + +EXPECTED='v0.0.1' +ACTUAL="$(nvm_alias test-blank-lines)" +EXIT_CODE="$(nvm_alias test-blank-lines 2>&1 >/dev/null; echo $?)" + +[ "${ACTUAL}" = "${EXPECTED}" ] || die "expected >${EXPECTED}<, got >${ACTUAL}<" +[ "${EXIT_CODE}" = '0' ] || die "expected exit code 0, got ${EXIT_CODE}" diff --git a/test/fast/Aliases/'nvmalias' should not accept aliases with slashes b/test/fast/Aliases/'nvmalias' should not accept aliases with slashes new file mode 100644 index 0000000..d10937d --- /dev/null +++ b/test/fast/Aliases/'nvmalias' should not accept aliases with slashes @@ -0,0 +1,26 @@ +#!/bin/sh + +\. ../../../nvm.sh + +die () { echo "$@" ; exit 1; } + +OUTPUT="$(nvm alias foo/bar baz 2>&1)" +EXPECTED_OUTPUT="Aliases in subdirectories are not supported." +[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to create an alias with a slash should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'" + +EXIT_CODE="$(nvm alias foo/bar baz >/dev/null 2>&1 ; echo $?)" +[ "$EXIT_CODE" = "1" ] || die "trying to create an alias with a slash should fail with code 1, got '$EXIT_CODE'" + +OUTPUT="$(nvm alias foo/ baz 2>&1)" +EXPECTED_OUTPUT="Aliases in subdirectories are not supported." +[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to create an alias ending with a slash should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'" + +EXIT_CODE="$(nvm alias foo/ baz >/dev/null 2>&1 ; echo $?)" +[ "$EXIT_CODE" = "1" ] || die "trying to create an alias ending with a slash should fail with code 1, got '$EXIT_CODE'" + +OUTPUT="$(nvm alias /bar baz 2>&1)" +EXPECTED_OUTPUT="Aliases in subdirectories are not supported." +[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to create an alias starting with a slash should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'" + +EXIT_CODE="$(nvm alias /bar baz >/dev/null 2>&1 ; echo $?)" +[ "$EXIT_CODE" = "1" ] || die "trying to create an alias starting with a slash should fail with code 1, got '$EXIT_CODE'" diff --git a/test/fast/Aliases/'nvmunalias' should accept aliases when they shadow a built-in alias b/test/fast/Aliases/'nvmunalias' should accept aliases when they shadow a built-in alias new file mode 100644 index 0000000..d88a4fa --- /dev/null +++ b/test/fast/Aliases/'nvmunalias' should accept aliases when they shadow a built-in alias @@ -0,0 +1,17 @@ +#!/bin/sh + +\. ../../../nvm.sh + +die () { echo "$@" ; exit 1; } + +OUTPUT="$(nvm unalias node 2>&1)" +EXPECTED_OUTPUT="node is a default (built-in) alias and cannot be deleted." +[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to remove a built-in alias should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'" + +nvm alias node stable || die '`nvm alias node stable` failed' + +nvm unalias node || die '`nvm unalias node` failed' + +OUTPUT="$(nvm unalias node 2>&1)" +EXPECTED_OUTPUT="node is a default (built-in) alias and cannot be deleted." +[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to remove a built-in alias should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'" diff --git a/test/fast/Aliases/'nvmunalias' should not accept aliases with names equal to built-in alias b/test/fast/Aliases/'nvmunalias' should not accept aliases with names equal to built-in alias new file mode 100644 index 0000000..35bdc8f --- /dev/null +++ b/test/fast/Aliases/'nvmunalias' should not accept aliases with names equal to built-in alias @@ -0,0 +1,25 @@ +#!/bin/sh + +\. ../../../nvm.sh + +die () { echo "$@" ; exit 1; } + +OUTPUT="$(nvm unalias node 2>&1)" +EXPECTED_OUTPUT="node is a default (built-in) alias and cannot be deleted." +[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to remove a built-in alias should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'" + +OUTPUT="$(nvm unalias stable 2>&1)" +EXPECTED_OUTPUT="stable is a default (built-in) alias and cannot be deleted." +[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to remove a built-in alias should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'" + +OUTPUT="$(nvm unalias unstable 2>&1)" +EXPECTED_OUTPUT="unstable is a default (built-in) alias and cannot be deleted." +[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to remove a built-in alias should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'" + +OUTPUT="$(nvm unalias iojs 2>&1)" +EXPECTED_OUTPUT="iojs is a default (built-in) alias and cannot be deleted." +[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to remove a built-in alias should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'" + +OUTPUT="$(nvm unalias system 2>&1)" +EXPECTED_OUTPUT="system is a default (built-in) alias and cannot be deleted." +[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to remove a built-in alias should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'" diff --git a/test/fast/Aliases/'nvmunalias' should not accept aliases with slashes b/test/fast/Aliases/'nvmunalias' should not accept aliases with slashes new file mode 100644 index 0000000..2afafad --- /dev/null +++ b/test/fast/Aliases/'nvmunalias' should not accept aliases with slashes @@ -0,0 +1,26 @@ +#!/bin/sh + +\. ../../../nvm.sh + +die () { echo "$@" ; exit 1; } + +OUTPUT="$(nvm unalias foo/bar 2>&1)" +EXPECTED_OUTPUT="Aliases in subdirectories are not supported." +[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to remove an alias with a slash should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'" + +EXIT_CODE="$(nvm unalias foo/bar >/dev/null 2>&1 ; echo $?)" +[ "$EXIT_CODE" = "1" ] || die "trying to remove an alias with a slash should fail with code 1, got '$EXIT_CODE'" + +OUTPUT="$(nvm unalias foo/ 2>&1)" +EXPECTED_OUTPUT="Aliases in subdirectories are not supported." +[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to remove an alias ending with a slash should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'" + +EXIT_CODE="$(nvm unalias foo/ >/dev/null 2>&1 ; echo $?)" +[ "$EXIT_CODE" = "1" ] || die "trying to remove an alias ending with a slash should fail with code 1, got '$EXIT_CODE'" + +OUTPUT="$(nvm unalias /bar 2>&1)" +EXPECTED_OUTPUT="Aliases in subdirectories are not supported." +[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "trying to remove an alias starting with a slash should fail with '$EXPECTED_OUTPUT', got '$OUTPUT'" + +EXIT_CODE="$(nvm unalias /bar >/dev/null 2>&1 ; echo $?)" +[ "$EXIT_CODE" = "1" ] || die "trying to remove an alias starting with a slash should fail with code 1, got '$EXIT_CODE'" diff --git a/test/fast/Aliases/Running 'nvm alias ˂aliasname˃ ˂target˃' again should change the target b/test/fast/Aliases/Running 'nvm alias ˂aliasname˃ ˂target˃' again should change the target old mode 100755 new mode 100644 diff --git a/test/fast/Aliases/Running 'nvm alias ˂aliasname˃' should list but one alias b/test/fast/Aliases/Running 'nvm alias ˂aliasname˃' should list but one alias old mode 100755 new mode 100644 diff --git a/test/fast/Aliases/Running 'nvm alias' lists implicit aliases when they do not exist b/test/fast/Aliases/Running 'nvm alias' lists implicit aliases when they do not exist old mode 100755 new mode 100644 diff --git a/test/fast/Aliases/Running 'nvm alias' lists manual aliases instead of implicit aliases when present b/test/fast/Aliases/Running 'nvm alias' lists manual aliases instead of implicit aliases when present old mode 100755 new mode 100644 diff --git a/test/fast/Aliases/Running 'nvm alias' should list all aliases b/test/fast/Aliases/Running 'nvm alias' should list all aliases old mode 100755 new mode 100644 diff --git a/test/fast/Aliases/Running'nvm alias ˂aliasname˃ ˂target˃' again should change the target b/test/fast/Aliases/Running'nvm alias ˂aliasname˃ ˂target˃' again should change the target new file mode 100644 index 0000000..f366beb --- /dev/null +++ b/test/fast/Aliases/Running'nvm alias ˂aliasname˃ ˂target˃' again should change the target @@ -0,0 +1,24 @@ +#!/bin/sh + +\. ../../../nvm.sh +\. ../../common.sh + +die () { echo "$@" ; exit 1; } + +if [ -n "$ZSH_VERSION" ]; then + # set clobber option in order to test that this does not produce any + # incompatibilities + setopt noclobber +fi + +nvm alias test-stable-1 0.0.2 || die '`nvm alias test-stable-1 0.0.2` failed' + +OUTPUT="$(nvm alias test-stable-1 | strip_colors)" +EXPECTED_OUTPUT='test-stable-1 -> 0.0.2 (-> v0.0.2)' +echo "$OUTPUT" | \grep -F "$EXPECTED_OUTPUT" || die "nvm alias test-stable-1 0.0.2 did not set test-stable-1 to 0.0.2: got '$OUTPUT'" + +nvm alias test-stable-1 0.0.1 || die '`nvm alias test-stable-1 0.0.1` failed' + +OUTPUT="$(nvm alias test-stable-1 | strip_colors)" +EXPECTED_OUTPUT='test-stable-1 -> 0.0.1 (-> v0.0.1)' +echo "$OUTPUT" | \grep -F "$EXPECTED_OUTPUT" || die "nvm alias test-stable-1 0.0.1 did not set test-stable-1 to 0.0.1: got '$OUTPUT'" diff --git a/test/fast/Aliases/Running'nvm alias ˂aliasname˃' should list but one alias b/test/fast/Aliases/Running'nvm alias ˂aliasname˃' should list but one alias new file mode 100644 index 0000000..7ba4c38 --- /dev/null +++ b/test/fast/Aliases/Running'nvm alias ˂aliasname˃' should list but one alias @@ -0,0 +1,4 @@ +#!/bin/sh + +\. ../../../nvm.sh +[ $(nvm alias test-stable-1 | wc -l) = '2' ] diff --git a/test/fast/Aliases/Running'nvm alias' lists implicit aliases when they do not exist b/test/fast/Aliases/Running'nvm alias' lists implicit aliases when they do not exist new file mode 100644 index 0000000..24a341c --- /dev/null +++ b/test/fast/Aliases/Running'nvm alias' lists implicit aliases when they do not exist @@ -0,0 +1,26 @@ +#!/bin/sh + +\. ../../../nvm.sh +\. ../../common.sh + +die () { echo "$@" ; exit 1; } + +NVM_ALIAS_OUTPUT=$(nvm alias | strip_colors) + +EXPECTED_STABLE="$(nvm_print_implicit_alias local stable)" +STABLE_VERSION="$(nvm_version "$EXPECTED_STABLE")" +echo "$NVM_ALIAS_OUTPUT" | \grep -F "stable -> $EXPECTED_STABLE (-> $STABLE_VERSION) (default)" \ + || die "nvm alias did not contain the default local stable node version; got '$NVM_ALIAS_OUTPUT'" + +echo "$NVM_ALIAS_OUTPUT" | \grep -F "node -> stable (-> $STABLE_VERSION) (default)" \ + || die "nvm alias did not contain the default local stable node version under 'node'; got '$NVM_ALIAS_OUTPUT'" + +EXPECTED_UNSTABLE="$(nvm_print_implicit_alias local unstable)" +UNSTABLE_VERSION="$(nvm_version "$EXPECTED_UNSTABLE")" +echo "$NVM_ALIAS_OUTPUT" | \grep -F "unstable -> $EXPECTED_UNSTABLE (-> $UNSTABLE_VERSION) (default)" \ + || die "nvm alias did not contain the default local unstable node version; got '$NVM_ALIAS_OUTPUT'" + +EXPECTED_IOJS="$(nvm_print_implicit_alias local iojs)" +IOJS_VERSION="$(nvm_version "$EXPECTED_IOJS")" +echo "$NVM_ALIAS_OUTPUT" | \grep -F "iojs -> $EXPECTED_IOJS (-> $IOJS_VERSION) (default)" \ + || die "nvm alias did not contain the default local iojs version; got '$NVM_ALIAS_OUTPUT'" diff --git a/test/fast/Aliases/Running'nvm alias' lists manual aliases instead of implicit aliases when present b/test/fast/Aliases/Running'nvm alias' lists manual aliases instead of implicit aliases when present new file mode 100644 index 0000000..1857f44 --- /dev/null +++ b/test/fast/Aliases/Running'nvm alias' lists manual aliases instead of implicit aliases when present @@ -0,0 +1,49 @@ +#!/bin/sh + +\. ../../../nvm.sh +\. ../../common.sh + +die () { echo "$@" ; cleanup ; exit 1; } +cleanup () { + rm -rf "$(nvm_alias_path)/stable" + rm -rf "$(nvm_alias_path)/unstable" + rm -rf "$(nvm_alias_path)/node" + rm -rf "$(nvm_alias_path)/iojs" + rm -rf "${NVM_DIR}/v0.8.1" + rm -rf "${NVM_DIR}/v0.9.1" + rm -rf "${NVM_DIR}/versions/io.js/v0.2.1" +} + +make_fake_node v0.8.1 +make_fake_node v0.9.1 +make_fake_iojs v0.2.1 + +EXPECTED_STABLE="$(nvm_print_implicit_alias local stable)" +STABLE_VERSION="$(nvm_version "$EXPECTED_STABLE")" + +EXPECTED_UNSTABLE="$(nvm_print_implicit_alias local unstable)" +UNSTABLE_VERSION="$(nvm_version "$EXPECTED_UNSTABLE")" + +[ "_$STABLE_VERSION" != "_$UNSTABLE_VERSION" ] \ + || die "stable and unstable versions are the same!" + +nvm alias stable "$EXPECTED_UNSTABLE" +nvm alias unstable "$EXPECTED_STABLE" +nvm alias node stable +nvm alias iojs unstable + +NVM_ALIAS_OUTPUT=$(nvm alias | strip_colors) + +echo "$NVM_ALIAS_OUTPUT" | command grep -F "stable -> $EXPECTED_UNSTABLE (-> $UNSTABLE_VERSION)" \ + || die "nvm alias did not contain the overridden 'stable' alias; got '$NVM_ALIAS_OUTPUT'" + +echo "$NVM_ALIAS_OUTPUT" | command grep -F "unstable -> $EXPECTED_STABLE (-> $STABLE_VERSION)" \ + || die "nvm alias did not contain the overridden 'unstable' alias; got '$NVM_ALIAS_OUTPUT'" + +echo "$NVM_ALIAS_OUTPUT" | command grep -F "node -> stable (-> $UNSTABLE_VERSION)" \ + || die "nvm alias did not contain the overridden 'node' alias; got '$NVM_ALIAS_OUTPUT'" + +echo "$NVM_ALIAS_OUTPUT" | command grep -F "iojs -> unstable (-> $STABLE_VERSION)" \ + || die "nvm alias did not contain the overridden 'iojs' alias; got '$NVM_ALIAS_OUTPUT'" + +cleanup diff --git a/test/fast/Aliases/Running'nvm alias' should list all aliases b/test/fast/Aliases/Running'nvm alias' should list all aliases new file mode 100644 index 0000000..d620fe5 --- /dev/null +++ b/test/fast/Aliases/Running'nvm alias' should list all aliases @@ -0,0 +1,48 @@ +#!/bin/sh + +\. ../../../nvm.sh +\. ../../common.sh + +die () { echo "$@" ; exit 1; } + +NVM_ALIAS_OUTPUT="$(nvm alias | strip_colors)" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-stable-1 -> 0.0.1 (-> v0.0.1)' \ + || die "did not find test-stable-1 alias; got '$NVM_ALIAS_OUTPUT'" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-stable-2 -> 0.0.2 (-> v0.0.2)' \ + || die "did not find test-stable-2 alias; got '$NVM_ALIAS_OUTPUT'" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-stable-3 -> 0.0.3 (-> v0.0.3)' \ + || die "did not find test-stable-3 alias; got '$NVM_ALIAS_OUTPUT'" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-stable-4 -> 0.0.4 (-> v0.0.4)' \ + || die "did not find test-stable-4 alias; got '$NVM_ALIAS_OUTPUT'" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-stable-5 -> 0.0.5 (-> v0.0.5)' \ + || die "did not find test-stable-5 alias; got '$NVM_ALIAS_OUTPUT'" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-stable-6 -> 0.0.6 (-> v0.0.6)' \ + || die "did not find test-stable-6 alias; got '$NVM_ALIAS_OUTPUT'" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-stable-7 -> 0.0.7 (-> v0.0.7)' \ + || die "did not find test-stable-7 alias; got '$NVM_ALIAS_OUTPUT'" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-stable-8 -> 0.0.8 (-> v0.0.8)' \ + || die "did not find test-stable-8 alias; got '$NVM_ALIAS_OUTPUT'" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-stable-9 -> 0.0.9 (-> v0.0.9)' \ + || die "did not find test-stable-9 alias; got '$NVM_ALIAS_OUTPUT'" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-stable-10 -> 0.0.10 (-> v0.0.10)' \ + || die "did not find test-stable-10 alias; got '$NVM_ALIAS_OUTPUT'" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-unstable-1 -> 0.1.1 (-> v0.1.1)' \ + || die "did not find test-unstable-1 alias; got '$NVM_ALIAS_OUTPUT'" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-unstable-2 -> 0.1.2 (-> v0.1.2)' \ + || die "did not find test-unstable-2 alias; got '$NVM_ALIAS_OUTPUT'" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-unstable-3 -> 0.1.3 (-> v0.1.3)' \ + || die "did not find test-unstable-3 alias; got '$NVM_ALIAS_OUTPUT'" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-unstable-4 -> 0.1.4 (-> v0.1.4)' \ + || die "did not find test-unstable-4 alias; got '$NVM_ALIAS_OUTPUT'" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-unstable-5 -> 0.1.5 (-> v0.1.5)' \ + || die "did not find test-unstable-5 alias; got '$NVM_ALIAS_OUTPUT'" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-unstable-6 -> 0.1.6 (-> v0.1.6)' \ + || die "did not find test-unstable-6 alias; got '$NVM_ALIAS_OUTPUT'" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-unstable-7 -> 0.1.7 (-> v0.1.7)' \ + || die "did not find test-unstable-7 alias; got '$NVM_ALIAS_OUTPUT'" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-unstable-8 -> 0.1.8 (-> v0.1.8)' \ + || die "did not find test-unstable-8 alias; got '$NVM_ALIAS_OUTPUT'" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-unstable-9 -> 0.1.9 (-> v0.1.9)' \ + || die "did not find test-unstable-9 alias; got '$NVM_ALIAS_OUTPUT'" +echo "$NVM_ALIAS_OUTPUT" | \grep -F 'test-unstable-10 -> 0.1.10 (-> v0.1.10)' \ + || die "did not find test-unstable-10 alias; got '$NVM_ALIAS_OUTPUT'" diff --git a/test/fast/Aliases/lts/'nvm alias' should ensure LTS alias dir exists b/test/fast/Aliases/lts/'nvm alias' should ensure LTS alias dir exists old mode 100755 new mode 100644 diff --git a/test/fast/Aliases/lts/'nvmalias' should ensure LTS alias dir exists b/test/fast/Aliases/lts/'nvmalias' should ensure LTS alias dir exists new file mode 100644 index 0000000..f6f3960 --- /dev/null +++ b/test/fast/Aliases/lts/'nvmalias' should ensure LTS alias dir exists @@ -0,0 +1,18 @@ +#!/bin/sh + +set -ex + +\. ../../../../nvm.sh +\. ../../../common.sh + +LTS_ALIAS_PATH="$(nvm_alias_path)/lts" + +rm -rf "${LTS_ALIAS_PATH}" + +die () { echo "$@" ; exit 1; } + +[ ! -d "${LTS_ALIAS_PATH}" ] || die "'${LTS_ALIAS_PATH}' exists and should not" + +nvm alias >/dev/null 2>&1 + +[ -d "${LTS_ALIAS_PATH}" ] || die "'${LTS_ALIAS_PATH}' does not exist and should" diff --git a/test/fast/Aliases/nvm_list_aliases calls nvm_get_colors b/test/fast/Aliases/nvm_list_aliases calls nvm_get_colors old mode 100755 new mode 100644 diff --git a/test/fast/Aliases/nvm_list_aliases works with LTS aliases b/test/fast/Aliases/nvm_list_aliases works with LTS aliases old mode 100755 new mode 100644 diff --git a/test/fast/Aliases/nvm_list_aliases works with no LTS aliases present b/test/fast/Aliases/nvm_list_aliases works with no LTS aliases present old mode 100755 new mode 100644 diff --git a/test/fast/Aliases/nvm_list_aliasescalls nvm_get_colors b/test/fast/Aliases/nvm_list_aliasescalls nvm_get_colors new file mode 100644 index 0000000..21e5127 --- /dev/null +++ b/test/fast/Aliases/nvm_list_aliasescalls nvm_get_colors @@ -0,0 +1,22 @@ +#!/bin/sh + +\. ../../../nvm.sh + +die () { echo "$@" ; exit 1; } + +set -e + +nvm_get_colors(){ + echo "0;95m" +} + +nvm_alias_path() { + nvm_echo "../../../alias" +} + +OUTPUT=$(command printf %b $(nvm_list_aliases test-stable-1) | awk '{ print substr($0, 1, 19); }') + +EXPECTED_OUTPUT=$(command printf %b "\033[0;95mtest-stable-1" | awk '{ print substr($0, 1, 19); }') +echo "\033[0m" + +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "nvm_list_aliases did not call nvm_get_colors. Expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<" diff --git a/test/fast/Aliases/nvm_list_aliasesworks with LTS aliases b/test/fast/Aliases/nvm_list_aliasesworks with LTS aliases new file mode 100644 index 0000000..6af1828 --- /dev/null +++ b/test/fast/Aliases/nvm_list_aliasesworks with LTS aliases @@ -0,0 +1,31 @@ +#!/bin/sh + +\. ../../../nvm.sh + +die () { + echo "$@" + exit 1 +} + +set -e + +MOCKS_DIR="../Unit tests/mocks" + +# sample output at the time the test was written +TAB_PATH="$MOCKS_DIR/nodejs.org-dist-index.tab" +nvm_download() { + cat "$TAB_PATH" +} + +nvm_alias_path() { + nvm_echo "../../../alias" +} + +nvm ls-remote >/dev/null || die 'nvm ls-remote (to populate LTS aliases) failed' + +EXPECTED_OUTPUT="$(cat "$MOCKS_DIR/lts-star.txt")" +STDOUT_OUTPUT="$(nvm_list_aliases "lts/*")" +STDERR_OUTPUT="$(nvm_list_aliases "lts/*" 2>&1 >/dev/null)" + +[ -z "${STDERR_OUTPUT}" ] || die "expected no stderr output, got >${STDERR_OUTPUT}<" +[ "${STDOUT_OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "expected ${EXPECTED_OUTPUT}, got >${STDOUT_OUTPUT}<" diff --git a/test/fast/Aliases/nvm_list_aliasesworks with no LTS aliases present b/test/fast/Aliases/nvm_list_aliasesworks with no LTS aliases present new file mode 100644 index 0000000..337d1d1 --- /dev/null +++ b/test/fast/Aliases/nvm_list_aliasesworks with no LTS aliases present @@ -0,0 +1,21 @@ +#!/bin/sh + +\. ../../../nvm.sh + +die () { + mv "$(nvm_alias_path)/_lts.bak" "$(nvm_alias_path)/lts" + echo "$@" + exit 1 +} + +set -e + +nvm_alias_path() { + nvm_echo "../../../alias" +} + +mv "$(nvm_alias_path)/lts" "$(nvm_alias_path)/_lts.bak" + +STDERR_OUTPUT="$(nvm_list_aliases 2>&1 >/dev/null)" + +[ -z "${STDERR_OUTPUT}" ] || die "expected no stderr output, got >${STDERR_OUTPUT}<" diff --git a/test/fast/Aliases/nvm_print_alias_path calls nvm_get_colors b/test/fast/Aliases/nvm_print_alias_path calls nvm_get_colors old mode 100755 new mode 100644 diff --git a/test/fast/Aliases/nvm_print_alias_pathcalls nvm_get_colors b/test/fast/Aliases/nvm_print_alias_pathcalls nvm_get_colors new file mode 100644 index 0000000..2c49b2a --- /dev/null +++ b/test/fast/Aliases/nvm_print_alias_pathcalls nvm_get_colors @@ -0,0 +1,28 @@ +#!/bin/sh + +\. ../../../nvm.sh + +die () { + # echo "$@" ; + echo "Expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<" + exit 1 +} + +set -e + +nvm_get_colors(){ + echo "0;95m" +} + +# nvm_print_alias_path call nvm_print_formatted_alias which calls nvm_get-colors +# the output of nvm_print_alias_path uses the color code returned by nvm_get_colors (redefined above) +NVM_ALIAS_DIR='../../../alias' + +OUTPUT=$(command printf %b $(nvm_print_alias_path "$NVM_ALIAS_DIR" "$NVM_ALIAS_DIR"/test-stable-1) | awk '{ print substr($0, 1, 24); }') + +EXPECTED_OUTPUT=$(command printf %b "\033[0;95mtest-stable-1\033[0m") + +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die + + +set +e diff --git a/test/fast/Aliases/nvm_print_formatted_alias calls nvm_get_colors b/test/fast/Aliases/nvm_print_formatted_alias calls nvm_get_colors old mode 100755 new mode 100644 diff --git a/test/fast/Aliases/nvm_print_formatted_aliascalls nvm_get_colors b/test/fast/Aliases/nvm_print_formatted_aliascalls nvm_get_colors new file mode 100644 index 0000000..7f82769 --- /dev/null +++ b/test/fast/Aliases/nvm_print_formatted_aliascalls nvm_get_colors @@ -0,0 +1,21 @@ +#!/bin/sh + +\. ../../../nvm.sh + +die () { + echo "Expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<" + exit 1 +} + +set -e +# # # expecting in red and two grays: +OUTPUT=$(echo $(nvm_print_formatted_alias fakealias fakedest) | awk '{ print substr($0, 1, 21); }') +EXPECTED_OUTPUT="$(command printf %b "\033[0;31mfakealias\033[0m ")" +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die + +# expecting in bold yellow and two grays: +nvm set-colors bbbYb +OUTPUT=$(echo $(nvm_print_formatted_alias fakealias fakedest) | awk '{ print substr($0, 1, 21); }') +EXPECTED_OUTPUT="$(command printf %b "\033[1;33mfakealias\033[0m ")" + +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die diff --git a/test/fast/Listing paths/Running 'nvm which 0.0.2' should display only version 0.0.2 b/test/fast/Listing paths/Running 'nvm which 0.0.2' should display only version 0.0.2 old mode 100755 new mode 100644 diff --git a/test/fast/Listing paths/Running 'nvm which foo' should return a nonzero exit code when not found b/test/fast/Listing paths/Running 'nvm which foo' should return a nonzero exit code when not found old mode 100755 new mode 100644 diff --git a/test/fast/Listing paths/Running'nvm which 0.0.2' should display only version 0.0.2 b/test/fast/Listing paths/Running'nvm which 0.0.2' should display only version 0.0.2 new file mode 100644 index 0000000..1f4eb11 --- /dev/null +++ b/test/fast/Listing paths/Running'nvm which 0.0.2' should display only version 0.0.2 @@ -0,0 +1,27 @@ +#!/bin/sh + +\. ../../../nvm.sh +\. ../../common.sh + +make_fake_node v0.0.2 +make_fake_node v0.0.20 +make_fake_node v0.12.0 + +die () { echo "$@" ; exit 1; } + +# The result should contain only the appropriate version numbers. + +nvm which 0.0.2 || die "v0.0.2 not found" +NVM_BIN="$(nvm which 0.0.2)" +[ "_$NVM_BIN" = "_$(nvm_version_path v0.0.2)/bin/node" ] \ + || die "'nvm which 0.0.2' did not contain the correct path: got '$NVM_BIN'" + +nvm which 0.0.20 || die "v0.0.20 not found" +NVM_BIN="$(nvm which 0.0.20)" +[ "_$NVM_BIN" = "_$(nvm_version_path v0.0.20)/bin/node" ] \ + || die "'nvm which 0.20.0' did not contain the correct path: got '$NVM_BIN'" + +nvm which 0.12.0 || die "v0.0.20 not found" +NVM_BIN="$(nvm which 0.12.0)" +[ "_$NVM_BIN" = "_$(nvm_version_path v0.12.0)/bin/node" ] \ + || die "'nvm which 0.12.0' did not contain the correct path: got '$NVM_BIN'" diff --git a/test/fast/Listing paths/Running'nvm which foo' should return a nonzero exit code when not found b/test/fast/Listing paths/Running'nvm which foo' should return a nonzero exit code when not found new file mode 100644 index 0000000..c0218a0 --- /dev/null +++ b/test/fast/Listing paths/Running'nvm which foo' should return a nonzero exit code when not found @@ -0,0 +1,6 @@ +#!/bin/sh + +\. ../../../nvm.sh + +nvm which nonexistent_version +[ "_$?" = "_1" ] diff --git a/test/fast/Listing versions/Running 'nvm ls --no-alias' does not call into nvm_alias b/test/fast/Listing versions/Running 'nvm ls --no-alias' does not call into nvm_alias old mode 100755 new mode 100644 diff --git a/test/fast/Listing versions/Running 'nvm ls --no-alias' with a pattern errors b/test/fast/Listing versions/Running 'nvm ls --no-alias' with a pattern errors old mode 100755 new mode 100644 diff --git a/test/fast/Listing versions/Running 'nvm ls 0.0.2' should display only version 0.0.2 b/test/fast/Listing versions/Running 'nvm ls 0.0.2' should display only version 0.0.2 old mode 100755 new mode 100644 diff --git a/test/fast/Listing versions/Running 'nvm ls 0.2' should display only 0.2.x versions b/test/fast/Listing versions/Running 'nvm ls 0.2' should display only 0.2.x versions old mode 100755 new mode 100644 diff --git a/test/fast/Listing versions/Running 'nvm ls foo' should return a nonzero exit code when not found b/test/fast/Listing versions/Running 'nvm ls foo' should return a nonzero exit code when not found old mode 100755 new mode 100644 diff --git a/test/fast/Listing versions/Running 'nvm ls io' should return NA b/test/fast/Listing versions/Running 'nvm ls io' should return NA old mode 100755 new mode 100644 diff --git a/test/fast/Listing versions/Running 'nvm ls node_' should return a nonzero exit code when not found b/test/fast/Listing versions/Running 'nvm ls node_' should return a nonzero exit code when not found old mode 100755 new mode 100644 diff --git a/test/fast/Listing versions/Running 'nvm ls stable' and 'nvm ls unstable' should return the appropriate implicit alias b/test/fast/Listing versions/Running 'nvm ls stable' and 'nvm ls unstable' should return the appropriate implicit alias old mode 100755 new mode 100644 diff --git a/test/fast/Listing versions/Running 'nvm ls system' should include 'system' when appropriate b/test/fast/Listing versions/Running 'nvm ls system' should include 'system' when appropriate old mode 100755 new mode 100644 diff --git a/test/fast/Listing versions/Running 'nvm ls' calls into nvm_alias b/test/fast/Listing versions/Running 'nvm ls' calls into nvm_alias old mode 100755 new mode 100644 diff --git a/test/fast/Listing versions/Running 'nvm ls' should display all installed versions b/test/fast/Listing versions/Running 'nvm ls' should display all installed versions old mode 100755 new mode 100644 diff --git a/test/fast/Listing versions/Running 'nvm ls' should filter out '.nvm' b/test/fast/Listing versions/Running 'nvm ls' should filter out '.nvm' old mode 100755 new mode 100644 diff --git a/test/fast/Listing versions/Running 'nvm ls' should filter out 'versions' b/test/fast/Listing versions/Running 'nvm ls' should filter out 'versions' old mode 100755 new mode 100644 diff --git a/test/fast/Listing versions/Running 'nvm ls' should include 'system' when appropriate b/test/fast/Listing versions/Running 'nvm ls' should include 'system' when appropriate old mode 100755 new mode 100644 diff --git a/test/fast/Listing versions/Running 'nvm ls' should list versions in the 'versions' directory b/test/fast/Listing versions/Running 'nvm ls' should list versions in the 'versions' directory old mode 100755 new mode 100644 diff --git a/test/fast/Listing versions/Running 'nvm ls' should not show a trailing slash b/test/fast/Listing versions/Running 'nvm ls' should not show a trailing slash old mode 100755 new mode 100644 diff --git a/test/fast/Listing versions/Running 'nvm ls' with node-like versioning vx.x.x should only list a matched version b/test/fast/Listing versions/Running 'nvm ls' with node-like versioning vx.x.x should only list a matched version old mode 100755 new mode 100644 diff --git a/test/fast/Listing versions/Running 'nvm ls' with nounset should not fail b/test/fast/Listing versions/Running 'nvm ls' with nounset should not fail old mode 100755 new mode 100644 diff --git a/test/fast/Listing versions/Running'nvm ls --no-alias' does not call into nvm_alias b/test/fast/Listing versions/Running'nvm ls --no-alias' does not call into nvm_alias new file mode 100644 index 0000000..20e28ec --- /dev/null +++ b/test/fast/Listing versions/Running'nvm ls --no-alias' does not call into nvm_alias @@ -0,0 +1,34 @@ +#!/bin/sh + +\. ../../../nvm.sh +\. ../../common.sh + +die () { echo "$@" ; unset -f nvm_ls nvm_list_aliases; exit 1; } + +make_fake_node v0.12.87 || die 'fake v0.12.87 could not be made' +make_fake_node v0.12.9 || die 'fake v0.12.9 could not be made' +make_fake_iojs v0.1.2 || die 'fake iojs-v0.1.2 could not be made' +make_fake_iojs v0.10.2 || die 'fake iojs-v0.10.2 could not be made' + +set -e + +nvm_list_aliases() { + echo 'sd-6' +} +# sanity check +OUTPUT="$(nvm alias)" +EXPECTED_OUTPUT='sd-6' +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "1: expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<" + +nvm_ls() { + echo v0.12.87 + echo v0.12.9 + echo iojs-v0.1.2 + echo iojs-v0.10.2 +} +OUTPUT="$(nvm ls --no-colors --no-alias)" +EXPECTED_OUTPUT=" v0.12.87 * + v0.12.9 * + iojs-v0.1.2 * + iojs-v0.10.2 *" +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "2: expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<" diff --git a/test/fast/Listing versions/Running'nvm ls --no-alias' with a pattern errors b/test/fast/Listing versions/Running'nvm ls --no-alias' with a pattern errors new file mode 100644 index 0000000..6f5a809 --- /dev/null +++ b/test/fast/Listing versions/Running'nvm ls --no-alias' with a pattern errors @@ -0,0 +1,15 @@ +#!/bin/sh + +\. ../../../nvm.sh +\. ../../common.sh + +die () { echo "$@" ; unset -f nvm_ls nvm_list_aliases; exit 1; } + +set -e + +OUTPUT="$(nvm ls --no-colors --no-alias pattern 2>&1 ||:)" +EXPECTED_OUTPUT='`--no-alias` is not supported when a pattern is provided.' +EXIT_CODE="$(nvm ls --no-colors --no-alias pattern >/dev/null 2>&1 || echo $?)" +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<" + +[ "${EXIT_CODE}" = 55 ] || die "expected 55; got >${EXIT_CODE}<" diff --git a/test/fast/Listing versions/Running'nvm ls 0.0.2' should display only version 0.0.2 b/test/fast/Listing versions/Running'nvm ls 0.0.2' should display only version 0.0.2 new file mode 100644 index 0000000..666a3f0 --- /dev/null +++ b/test/fast/Listing versions/Running'nvm ls 0.0.2' should display only version 0.0.2 @@ -0,0 +1,21 @@ +#!/bin/sh + +\. ../../../nvm.sh +\. ../../common.sh + +make_fake_node v0.0.2 +make_fake_node v0.0.20 + +die () { echo "$@" ; exit 1; } + +# The result should contain only the appropriate version numbers. + +nvm ls 0.0.2 | grep 'v0.0.2' > /dev/null +if [ $? -eq 0 ]; then + echo '"nvm ls 0.0.2" contained v0.0.2' +fi + +nvm ls 0.0.2 | grep 'v0.0.20' > /dev/null +if [ $? -eq 0 ]; then + die '"nvm ls 0.0.2" contained v0.0.20' +fi diff --git a/test/fast/Listing versions/Running'nvm ls 0.2' should display only 0.2.x versions b/test/fast/Listing versions/Running'nvm ls 0.2' should display only 0.2.x versions new file mode 100644 index 0000000..b02efa3 --- /dev/null +++ b/test/fast/Listing versions/Running'nvm ls 0.2' should display only 0.2.x versions @@ -0,0 +1,42 @@ +#!/bin/sh + +\. ../../../nvm.sh +\. ../../common.sh + +make_fake_node v0.1.3 +make_fake_node v0.2.3 +make_fake_node v0.20.3 + +die () { echo "$@" ; exit 1; } + +# The result should contain only the appropriate version numbers. + +nvm ls 0.1 | grep 'v0.2.3' > /dev/null +if [ $? -eq 0 ]; then + echo '"nvm ls 0.1" contained v0.2.3' +fi + +nvm ls 0.1 | grep 'v0.20.3' > /dev/null +if [ $? -eq 0 ]; then + die '"nvm ls 0.1" contained v0.20.3' +fi + +nvm ls 0.1 | grep 'v0.1.3' > /dev/null +if [ $? -ne 0 ]; then + die '"nvm ls 0.1" did not contain v0.1.3' +fi + +nvm ls 0.2 | grep 'v0.2.3' > /dev/null +if [ $? -ne 0 ]; then + die '"nvm ls 0.2" did not contain v0.2.3' +fi + +nvm ls 0.2 | grep 'v0.20.3' > /dev/null +if [ $? -eq 0 ]; then + die '"nvm ls 0.2" contained v0.20.3' +fi + +nvm ls 0.2 | grep 'v0.2.3' > /dev/null +if [ $? -ne 0 ]; then + die '"nvm ls 0.2" did not contain v0.2.3' +fi diff --git a/test/fast/Listing versions/Running'nvm ls foo' should return a nonzero exit code when not found b/test/fast/Listing versions/Running'nvm ls foo' should return a nonzero exit code when not found new file mode 100644 index 0000000..74a97b4 --- /dev/null +++ b/test/fast/Listing versions/Running'nvm ls foo' should return a nonzero exit code when not found @@ -0,0 +1,6 @@ +#!/bin/sh + +\. ../../../nvm.sh + +nvm ls nonexistent_version +[ "$?" = "3" ] diff --git a/test/fast/Listing versions/Running'nvm ls io' should return NA b/test/fast/Listing versions/Running'nvm ls io' should return NA new file mode 100644 index 0000000..79dccfe --- /dev/null +++ b/test/fast/Listing versions/Running'nvm ls io' should return NA @@ -0,0 +1,6 @@ +#!/bin/sh + +\. ../../../nvm.sh + +nvm ls io +[ "$?" = "3" ] diff --git a/test/fast/Listing versions/Running'nvm ls node_' should return a nonzero exit code when not found b/test/fast/Listing versions/Running'nvm ls node_' should return a nonzero exit code when not found new file mode 100644 index 0000000..af79302 --- /dev/null +++ b/test/fast/Listing versions/Running'nvm ls node_' should return a nonzero exit code when not found @@ -0,0 +1,6 @@ +#!/bin/sh + +\. ../../../nvm.sh + +nvm ls node_ +[ "$?" = "3" ] diff --git a/test/fast/Listing versions/Running'nvm ls stable' and 'nvm ls unstable' should return the appropriate implicit alias b/test/fast/Listing versions/Running'nvm ls stable' and 'nvm ls unstable' should return the appropriate implicit alias new file mode 100644 index 0000000..78d0a50 --- /dev/null +++ b/test/fast/Listing versions/Running'nvm ls stable' and 'nvm ls unstable' should return the appropriate implicit alias @@ -0,0 +1,29 @@ +#!/bin/sh + +\. ../../../nvm.sh +\. ../../common.sh + +die () { echo "$@" ; exit 1; } + +make_fake_node v0.2.3 +make_fake_node v0.3.3 + +EXPECTED_STABLE="$(nvm_print_implicit_alias local stable)" +STABLE_VERSION="$(nvm_version "$EXPECTED_STABLE")" + +EXPECTED_UNSTABLE="$(nvm_print_implicit_alias local unstable)" +UNSTABLE_VERSION="$(nvm_version "$EXPECTED_UNSTABLE")" + +nvm ls stable | \grep "$STABLE_VERSION" >/dev/null \ + || die "expected 'nvm ls stable' to give $STABLE_VERSION, got $(nvm ls stable)" + +nvm ls unstable | \grep "$UNSTABLE_VERSION" >/dev/null \ + || die "expected 'nvm ls unstable' to give $UNSTABLE_VERSION, got $(nvm ls unstable)" + +make_fake_node v0.1.4 +nvm alias stable 0.1 + +nvm ls stable | \grep -v "$STABLE_VERSION" >/dev/null \ + || die "'nvm ls stable' contained $STABLE_VERSION instead of v0.1.4" +nvm ls stable | \grep v0.1.4 >/dev/null \ + || die "'nvm ls stable' did not contain v0.1.4" diff --git a/test/fast/Listing versions/Running'nvm ls system' should include 'system' when appropriate b/test/fast/Listing versions/Running'nvm ls system' should include 'system' when appropriate new file mode 100644 index 0000000..1d39a41 --- /dev/null +++ b/test/fast/Listing versions/Running'nvm ls system' should include 'system' when appropriate @@ -0,0 +1,21 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh +\. ../../common.sh + +make_fake_node v0.0.1 +make_fake_node v0.0.3 +make_fake_node v0.0.9 +make_fake_node v0.3.1 +make_fake_node v0.3.3 +make_fake_node v0.3.9 + +nvm_has_system_node() { return 0; } +nvm ls system | grep system 2>&1 > /dev/null +[ $? -eq 0 ] || die '"nvm ls system" did not contain "system" when system node is present' + +nvm_has_system_node() { return 1; } +nvm ls system | grep system 2>&1 > /dev/null +[ $? -ne 0 ] || die '"nvm ls system" contained "system" when system node is not present' diff --git a/test/fast/Listing versions/Running'nvm ls' calls into nvm_alias b/test/fast/Listing versions/Running'nvm ls' calls into nvm_alias new file mode 100644 index 0000000..a5f7457 --- /dev/null +++ b/test/fast/Listing versions/Running'nvm ls' calls into nvm_alias @@ -0,0 +1,35 @@ +#!/bin/sh + +\. ../../../nvm.sh +\. ../../common.sh + +die () { echo "$@" ; unset -f nvm_ls nvm_list_aliases; exit 1; } + +make_fake_node v0.12.87 || die 'fake v0.12.87 could not be made' +make_fake_node v0.12.9 || die 'fake v0.12.9 could not be made' +make_fake_iojs v0.1.2 || die 'fake iojs-v0.1.2 could not be made' +make_fake_iojs v0.10.2 || die 'fake iojs-v0.10.2 could not be made' + +set -e + +nvm_list_aliases() { + echo 'sd-6' +} +# sanity check +OUTPUT="$(nvm alias)" +EXPECTED_OUTPUT='sd-6' +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "1: expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<" + +nvm_ls() { + echo v0.12.87 + echo v0.12.9 + echo iojs-v0.1.2 + echo iojs-v0.10.2 +} +OUTPUT="$(nvm ls --no-colors)" +EXPECTED_OUTPUT=" v0.12.87 * + v0.12.9 * + iojs-v0.1.2 * + iojs-v0.10.2 * +sd-6" +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "2: expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<" diff --git a/test/fast/Listing versions/Running'nvm ls' should display all installed versions b/test/fast/Listing versions/Running'nvm ls' should display all installed versions new file mode 100644 index 0000000..92e0270 --- /dev/null +++ b/test/fast/Listing versions/Running'nvm ls' should display all installed versions @@ -0,0 +1,44 @@ +#!/bin/sh + +\. ../../../nvm.sh +\. ../../common.sh + +die () { echo "$@" ; exit 1; } + +make_fake_node v0.0.1 +make_fake_node v0.0.3 +make_fake_node v0.0.9 +make_fake_node v0.3.1 +make_fake_node v0.3.3 +make_fake_node v0.3.9 +make_fake_node v0.12.87 +make_fake_node v0.12.9 +make_fake_iojs v0.1.2 +make_fake_iojs v0.10.2 + +# The result should contain the version numbers. +nvm ls | grep v0.0.1 >/dev/null || die "v0.0.1 not found in: $(nvm ls)" +nvm ls | grep v0.0.3 >/dev/null || die "v0.0.3 not found in: $(nvm ls)" +nvm ls | grep v0.0.9 >/dev/null || die "v0.0.9 not found in: $(nvm ls)" +nvm ls | grep v0.3.1 >/dev/null || die "v0.3.1 not found in: $(nvm ls)" +nvm ls | grep v0.3.3 >/dev/null || die "v0.3.3 not found in: $(nvm ls)" +nvm ls | grep v0.3.9 >/dev/null || die "v0.3.9 not found in: $(nvm ls)" +nvm ls | grep v0.12.87 >/dev/null || die "v0.12.87 not found in: $(nvm ls)" +nvm ls | grep iojs-v0.1.2 >/dev/null || die "iojs-v0.1.2 not found in: $(nvm ls)" + +OUTPUT="$(nvm_ls)" +EXPECTED_OUTPUT="v0.0.1 +v0.0.3 +v0.0.9 +iojs-v0.1.2 +v0.3.1 +v0.3.3 +v0.3.9 +iojs-v0.10.2 +v0.12.9 +v0.12.87" +if nvm_has_system_node || nvm_has_system_iojs; then + EXPECTED_OUTPUT="${EXPECTED_OUTPUT} +system" +fi +[ "${OUTPUT-}" = "${EXPECTED_OUTPUT-}" ] || die "expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<" diff --git a/test/fast/Listing versions/Running'nvm ls' should filter out '.nvm' b/test/fast/Listing versions/Running'nvm ls' should filter out '.nvm' new file mode 100644 index 0000000..dedb541 --- /dev/null +++ b/test/fast/Listing versions/Running'nvm ls' should filter out '.nvm' @@ -0,0 +1,10 @@ +#!/bin/sh + +\. ../../../nvm.sh +\. ../../common.sh + +make_fake_node v0.1.3 +make_fake_node v0.2.3 + +[ -z `nvm ls | grep '^ *\.'` ] +# The result should contain only the appropriate version numbers. diff --git a/test/fast/Listing versions/Running'nvm ls' should filter out 'versions' b/test/fast/Listing versions/Running'nvm ls' should filter out 'versions' new file mode 100644 index 0000000..bd0c709 --- /dev/null +++ b/test/fast/Listing versions/Running'nvm ls' should filter out 'versions' @@ -0,0 +1,10 @@ +#!/bin/sh + +\. ../../../nvm.sh +\. ../../common.sh + +make_fake_node v0.1.3 +make_fake_node v0.2.3 + +[ -z "$(nvm ls | \grep 'versions')" ] +# The result should contain only the appropriate version numbers. diff --git a/test/fast/Listing versions/Running'nvm ls' should include 'system' when appropriate b/test/fast/Listing versions/Running'nvm ls' should include 'system' when appropriate new file mode 100644 index 0000000..9c465c0 --- /dev/null +++ b/test/fast/Listing versions/Running'nvm ls' should include 'system' when appropriate @@ -0,0 +1,21 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh +\. ../../common.sh + +make_fake_node v0.0.1 +make_fake_node v0.0.3 +make_fake_node v0.0.9 +make_fake_node v0.3.1 +make_fake_node v0.3.3 +make_fake_node v0.3.9 + +nvm_has_system_node() { return 0; } +nvm ls | grep system 2>&1 > /dev/null +[ $? -eq 0 ] || die '"nvm ls" did not contain "system" when system node is present' + +nvm_has_system_node() { return 1; } +nvm ls | grep system 2>&1 > /dev/null +[ $? -ne 0 ] || die '"nvm ls" contained "system" when system node is not present' diff --git a/test/fast/Listing versions/Running'nvm ls' should list versions in the 'versions' directory b/test/fast/Listing versions/Running'nvm ls' should list versions in the 'versions' directory new file mode 100644 index 0000000..a2a31e2 --- /dev/null +++ b/test/fast/Listing versions/Running'nvm ls' should list versions in the 'versions' directory @@ -0,0 +1,12 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh +\. ../../common.sh + +make_fake_node v0.12.1 +make_fake_node v0.1.3 + +nvm ls 0.12 | grep v0.12.1 || die '"nvm ls" did not list a version in the versions/ directory' +nvm ls 0.1 | grep v0.1.3 || die '"nvm ls" did not list a version not in the versions/ directory' diff --git a/test/fast/Listing versions/Running'nvm ls' should not show a trailing slash b/test/fast/Listing versions/Running'nvm ls' should not show a trailing slash new file mode 100644 index 0000000..e3dbd5b --- /dev/null +++ b/test/fast/Listing versions/Running'nvm ls' should not show a trailing slash @@ -0,0 +1,42 @@ +#!/bin/zsh + +export NVM_DIR="$(cd ../../.. && pwd)" + +\. ../../../nvm.sh +\. ../../common.sh + +if type setopt >/dev/null 2>&1; then setopt local_options markdirs; fi + +die () { + if type unsetopt >/dev/null 2>&1; then unsetopt local_options markdirs; fi + echo "$@"; + exit 1; +} + +make_fake_node v0.0.1 +make_fake_node v0.0.3 +make_fake_node v0.0.9 +make_fake_node v0.3.1 +make_fake_node v0.3.3 +make_fake_node v0.3.9 +make_fake_node v0.12.87 +make_fake_node v0.12.9 +make_fake_iojs v0.1.2 +make_fake_iojs v0.10.2 + +OUTPUT="$(nvm_ls)" +EXPECTED_OUTPUT="v0.0.1 +v0.0.3 +v0.0.9 +iojs-v0.1.2 +v0.3.1 +v0.3.3 +v0.3.9 +iojs-v0.10.2 +v0.12.9 +v0.12.87" +if nvm_has_system_node || nvm_has_system_iojs; then + EXPECTED_OUTPUT="${EXPECTED_OUTPUT} +system" +fi +[ "${OUTPUT-}" = "${EXPECTED_OUTPUT-}" ] || die "expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<" diff --git a/test/fast/Listing versions/Running'nvm ls' with node-like versioning vx.x.x should only list a matched version b/test/fast/Listing versions/Running'nvm ls' with node-like versioning vx.x.x should only list a matched version new file mode 100644 index 0000000..cb54278 --- /dev/null +++ b/test/fast/Listing versions/Running'nvm ls' with node-like versioning vx.x.x should only list a matched version @@ -0,0 +1,11 @@ +#!/bin/sh + +\. ../../../nvm.sh +\. ../../common.sh + +make_fake_node v0.1.2 + +nvm ls v0.1 | grep v0.1.2 && +nvm ls v0.1.2 | grep v0.1.2 && +nvm ls v0.1. | grep v0.1.2 && +nvm ls v0.1.1 | grep N/A diff --git a/test/fast/Listing versions/Running'nvm ls' with nounset should not fail b/test/fast/Listing versions/Running'nvm ls' with nounset should not fail new file mode 100644 index 0000000..d2bfe9e --- /dev/null +++ b/test/fast/Listing versions/Running'nvm ls' with nounset should not fail @@ -0,0 +1,23 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh +\. ../../common.sh + +make_fake_node v0.12.34 || die 'fake v0.12.34 could not be made' + +# Enable no unset variable +set -u + +# Try an alias that does not exist +output=$(nvm ls 99 2>&1 1>/dev/null || true) +test -z "${output}" || die "1: expected empty; got >${output}" + +# Try a version that does not exist +output=$(nvm ls 0.12.00 2>&1 1>/dev/null || true) +test -z "${output}" || die "2: expected empty; got >${output}" + +# Try a version that does exist +output=$(nvm ls 0.12.34 2>&1 1>/dev/null || true) +test -z "${output}" || die "3: expected empty; got >${output}" diff --git a/test/fast/Listing versions/Using a nonstandard IFS should not break b/test/fast/Listing versions/Using a nonstandard IFS should not break old mode 100755 new mode 100644 diff --git a/test/fast/Listing versions/Usinga nonstandard IFS should not break b/test/fast/Listing versions/Usinga nonstandard IFS should not break new file mode 100644 index 0000000..27cf2de --- /dev/null +++ b/test/fast/Listing versions/Usinga nonstandard IFS should not break @@ -0,0 +1,19 @@ +#!/bin/sh + +\. ../../../nvm.sh +\. ../../common.sh + +make_fake_node v0.0.1 +make_fake_node v0.0.3 +make_fake_node v0.0.9 +make_fake_node v0.3.1 +make_fake_node v0.3.3 +make_fake_node v0.3.9 +make_fake_node v0.12.87 +make_fake_node v0.12.9 +make_fake_iojs v0.1.2 +make_fake_iojs v0.10.2 + +set -e + +IFS='' nvm ls diff --git a/test/fast/Set Colors/nvm_print_default_alias calls nvm_get_colors b/test/fast/Set Colors/nvm_print_default_alias calls nvm_get_colors old mode 100755 new mode 100644 diff --git a/test/fast/Set Colors/nvm_print_default_aliascalls nvm_get_colors b/test/fast/Set Colors/nvm_print_default_aliascalls nvm_get_colors new file mode 100644 index 0000000..64a2a08 --- /dev/null +++ b/test/fast/Set Colors/nvm_print_default_aliascalls nvm_get_colors @@ -0,0 +1,24 @@ +#!/bin/sh + +\. ../../../nvm.sh + +die () { + # echo "$@" ; + echo "Expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<" + exit 1 +} + +set -e + +nvm_get_colors(){ + echo "0;95m" +} + +# nvm_print_default_alias call nvm_print_formatted_alias which calls nvm_get-colors +# the output of nvm_print_default_alias uses the color code returned by nvm_get_colors (redefined above) +OUTPUT=$(command printf %b $(nvm_print_default_alias node ./alias v14.7.0) | awk '{ print substr($0, 1, 11); }') +EXPECTED_OUTPUT=$(command printf %b "\033[0;95mnode") + +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die + +set +e diff --git a/test/fast/Set Colors/nvm_print_versions calls nvm_get_colors b/test/fast/Set Colors/nvm_print_versions calls nvm_get_colors old mode 100755 new mode 100644 diff --git a/test/fast/Set Colors/nvm_print_versionscalls nvm_get_colors b/test/fast/Set Colors/nvm_print_versionscalls nvm_get_colors new file mode 100644 index 0000000..55e2334 --- /dev/null +++ b/test/fast/Set Colors/nvm_print_versionscalls nvm_get_colors @@ -0,0 +1,52 @@ +#!/bin/sh + +\. ../../../nvm.sh + +set -e + +die () { + # echo "$@" ; + echo "Expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<" + exit 1 +} +cleanup() { + if [ -n TEMP_NVM_COLORS ]; then + export NVM_COLORS=TEMP_NVM_COLORS + fi + unset TEMP_NVM_COLORS +} + +if [ -n ${NVM_COLORS} ]; then + export TEMP_NVM_COLORS=NVM_COLORS + unset NVM_COLORS +fi + +# default system color +nvm use system +OUTPUT=$(nvm_print_versions system) +FORMAT="\033[0;32m-> %12s\033[0m" +VERSION='system' +EXPECTED_OUTPUT=$(command printf -- "${FORMAT}\\n" "${VERSION}") + +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die + +nvm_ls_current() { echo "current";} + +# default current color +OUTPUT=$(nvm_print_versions current) +FORMAT="\033[0;32m-> %12s\033[0m" +VERSION="current" +EXPECTED_OUTPUT=$(command printf -- "${FORMAT}\\n" "${VERSION}") + +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die + +# custom current color +nvm set-colors YCMGR +OUTPUT=$(nvm_print_versions current) +FORMAT="\033[1;35m-> %12s\033[0m" +VERSION="current" +EXPECTED_OUTPUT=$(command printf -- "${FORMAT}\\n" "${VERSION}") + +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die + +cleanup diff --git a/test/fast/Unit tests/mocks/nvm_ls_remoteLTS argon.txt b/test/fast/Unit tests/mocks/nvm_ls_remoteLTS argon.txt new file mode 100644 index 0000000..78d685d --- /dev/null +++ b/test/fast/Unit tests/mocks/nvm_ls_remoteLTS argon.txt @@ -0,0 +1,36 @@ +v4.2.0 Argon +v4.2.1 Argon +v4.2.2 Argon +v4.2.3 Argon +v4.2.4 Argon +v4.2.5 Argon +v4.2.6 Argon +v4.3.0 Argon +v4.3.1 Argon +v4.3.2 Argon +v4.4.0 Argon +v4.4.1 Argon +v4.4.2 Argon +v4.4.3 Argon +v4.4.4 Argon +v4.4.5 Argon +v4.4.6 Argon +v4.4.7 Argon +v4.5.0 Argon +v4.6.0 Argon +v4.6.1 Argon +v4.6.2 Argon +v4.7.0 Argon +v4.7.1 Argon +v4.7.2 Argon +v4.7.3 Argon +v4.8.0 Argon +v4.8.1 Argon +v4.8.2 Argon +v4.8.3 Argon +v4.8.4 Argon +v4.8.5 Argon +v4.8.6 Argon +v4.8.7 Argon +v4.9.0 Argon +v4.9.1 Argon * diff --git a/test/fast/Unit tests/mocks/nvm_ls_remoteLTS nightly argon.txt b/test/fast/Unit tests/mocks/nvm_ls_remoteLTS nightly argon.txt new file mode 100644 index 0000000..f0a2463 --- /dev/null +++ b/test/fast/Unit tests/mocks/nvm_ls_remoteLTS nightly argon.txt @@ -0,0 +1 @@ +N/A diff --git a/test/fast/Unit tests/mocks/nvm_ls_remoteLTS nightly.txt b/test/fast/Unit tests/mocks/nvm_ls_remoteLTS nightly.txt new file mode 100644 index 0000000..ef5e4d9 --- /dev/null +++ b/test/fast/Unit tests/mocks/nvm_ls_remoteLTS nightly.txt @@ -0,0 +1,6 @@ +v6.9.6-nightly201702013f61aae59d Boron * +v8.9.1-nightly20171104a815e1b6a2 Carbon * +v10.15.3-nightly20190301156e4c8e89 Dubnium +v10.15.4-nightly201905019101d9368f Dubnium +v10.16.2-nightly20190801f025f8524b Dubnium * +v12.22.10-nightly2022012660c9d3bb95 Erbium * diff --git a/test/fast/Unit tests/mocks/nvm_ls_remoteLTS.txt b/test/fast/Unit tests/mocks/nvm_ls_remoteLTS.txt new file mode 100644 index 0000000..2db2902 --- /dev/null +++ b/test/fast/Unit tests/mocks/nvm_ls_remoteLTS.txt @@ -0,0 +1,212 @@ +v4.2.0 Argon +v4.2.1 Argon +v4.2.2 Argon +v4.2.3 Argon +v4.2.4 Argon +v4.2.5 Argon +v4.2.6 Argon +v4.3.0 Argon +v4.3.1 Argon +v4.3.2 Argon +v4.4.0 Argon +v4.4.1 Argon +v4.4.2 Argon +v4.4.3 Argon +v4.4.4 Argon +v4.4.5 Argon +v4.4.6 Argon +v4.4.7 Argon +v4.5.0 Argon +v4.6.0 Argon +v4.6.1 Argon +v4.6.2 Argon +v4.7.0 Argon +v4.7.1 Argon +v4.7.2 Argon +v4.7.3 Argon +v4.8.0 Argon +v4.8.1 Argon +v4.8.2 Argon +v4.8.3 Argon +v4.8.4 Argon +v4.8.5 Argon +v4.8.6 Argon +v4.8.7 Argon +v4.9.0 Argon +v4.9.1 Argon * +v6.9.0 Boron +v6.9.1 Boron +v6.9.2 Boron +v6.9.3 Boron +v6.9.4 Boron +v6.9.5 Boron +v6.10.0 Boron +v6.10.1 Boron +v6.10.2 Boron +v6.10.3 Boron +v6.11.0 Boron +v6.11.1 Boron +v6.11.2 Boron +v6.11.3 Boron +v6.11.4 Boron +v6.11.5 Boron +v6.12.0 Boron +v6.12.1 Boron +v6.12.2 Boron +v6.12.3 Boron +v6.13.0 Boron +v6.13.1 Boron +v6.14.0 Boron +v6.14.1 Boron +v6.14.2 Boron +v6.14.3 Boron +v6.14.4 Boron +v6.15.0 Boron +v6.15.1 Boron +v6.16.0 Boron +v6.17.0 Boron +v6.17.1 Boron * +v8.9.0 Carbon +v8.9.1 Carbon +v8.9.2 Carbon +v8.9.3 Carbon +v8.9.4 Carbon +v8.10.0 Carbon +v8.11.0 Carbon +v8.11.1 Carbon +v8.11.2 Carbon +v8.11.3 Carbon +v8.11.4 Carbon +v8.12.0 Carbon +v8.13.0 Carbon +v8.14.0 Carbon +v8.14.1 Carbon +v8.15.0 Carbon +v8.15.1 Carbon +v8.16.0 Carbon +v8.16.1 Carbon +v8.16.2 Carbon +v8.17.0 Carbon * +v10.13.0 Dubnium +v10.14.0 Dubnium +v10.14.1 Dubnium +v10.14.2 Dubnium +v10.15.0 Dubnium +v10.15.1 Dubnium +v10.15.2 Dubnium +v10.15.3 Dubnium +v10.16.0 Dubnium +v10.16.1 Dubnium +v10.16.2 Dubnium +v10.16.3 Dubnium +v10.17.0 Dubnium +v10.18.0 Dubnium +v10.18.1 Dubnium +v10.19.0 Dubnium +v10.20.0 Dubnium +v10.20.1 Dubnium +v10.21.0 Dubnium +v10.22.0 Dubnium +v10.22.1 Dubnium +v10.23.0 Dubnium +v10.23.1 Dubnium +v10.23.2 Dubnium +v10.23.3 Dubnium +v10.24.0 Dubnium +v10.24.1 Dubnium * +v12.13.0 Erbium +v12.13.1 Erbium +v12.14.0 Erbium +v12.14.1 Erbium +v12.15.0 Erbium +v12.16.0 Erbium +v12.16.1 Erbium +v12.16.2 Erbium +v12.16.3 Erbium +v12.17.0 Erbium +v12.18.0 Erbium +v12.18.1 Erbium +v12.18.2 Erbium +v12.18.3 Erbium +v12.18.4 Erbium +v12.19.0 Erbium +v12.19.1 Erbium +v12.20.0 Erbium +v12.20.1 Erbium +v12.20.2 Erbium +v12.21.0 Erbium +v12.22.0 Erbium +v12.22.1 Erbium +v12.22.2 Erbium +v12.22.3 Erbium +v12.22.4 Erbium +v12.22.5 Erbium +v12.22.6 Erbium +v12.22.7 Erbium +v12.22.8 Erbium +v12.22.9 Erbium +v12.22.10 Erbium +v12.22.11 Erbium +v12.22.12 Erbium * +v14.15.0 Fermium +v14.15.1 Fermium +v14.15.2 Fermium +v14.15.3 Fermium +v14.15.4 Fermium +v14.15.5 Fermium +v14.16.0 Fermium +v14.16.1 Fermium +v14.17.0 Fermium +v14.17.1 Fermium +v14.17.2 Fermium +v14.17.3 Fermium +v14.17.4 Fermium +v14.17.5 Fermium +v14.17.6 Fermium +v14.18.0 Fermium +v14.18.1 Fermium +v14.18.2 Fermium +v14.18.3 Fermium +v14.19.0 Fermium +v14.19.1 Fermium +v14.19.2 Fermium +v14.19.3 Fermium +v14.20.0 Fermium +v14.20.1 Fermium +v14.21.0 Fermium +v14.21.1 Fermium +v14.21.2 Fermium +v14.21.3 Fermium * +v16.13.0 Gallium +v16.13.1 Gallium +v16.13.2 Gallium +v16.14.0 Gallium +v16.14.1 Gallium +v16.14.2 Gallium +v16.15.0 Gallium +v16.15.1 Gallium +v16.16.0 Gallium +v16.17.0 Gallium +v16.17.1 Gallium +v16.18.0 Gallium +v16.18.1 Gallium +v16.19.0 Gallium +v16.19.1 Gallium +v16.20.0 Gallium +v16.20.1 Gallium +v16.20.2 Gallium * +v18.12.0 Hydrogen +v18.12.1 Hydrogen +v18.13.0 Hydrogen +v18.14.0 Hydrogen +v18.14.1 Hydrogen +v18.14.2 Hydrogen +v18.15.0 Hydrogen +v18.16.0 Hydrogen +v18.16.1 Hydrogen +v18.17.0 Hydrogen +v18.17.1 Hydrogen +v18.18.0 Hydrogen +v18.18.1 Hydrogen +v18.18.2 Hydrogen * +v20.9.0 Iron * diff --git a/test/fast/Unit tests/mocks/nvm_ls_remotenightly.txt b/test/fast/Unit tests/mocks/nvm_ls_remotenightly.txt new file mode 100644 index 0000000..e697d8c --- /dev/null +++ b/test/fast/Unit tests/mocks/nvm_ls_remotenightly.txt @@ -0,0 +1,49 @@ +v0.10.41-nightly20151203036580393d +v0.10.42-nightly20160128b125512a5c +v0.12.10-nightly20160128a305339f66 +v4.0.0-nightly201509079cae65c510 +v5.7.1-nightly20160301c83725c604 +v5.7.2-nightly2016030801c331ea37 +v5.11.1-nightly2016050199920480ae +v5.11.2-nightly2016060121552bd0c5 +v6.0.0-nightly20160301d9f7a597e4 +v6.5.1-nightly20160901180867d6a6 +v6.7.1-nightly20161001d7454e7547 +v6.9.6-nightly201702013f61aae59d Boron * +v7.0.0-nightly20161001c8c2544cd9 +v7.5.1-nightly2017020113a024d531 +v7.7.1-nightly201703019c75f4c78a +v7.9.1-nightly20170411675ece47b3 +v8.0.0-nightly201705010f58d3cbef +v8.2.1-nightly2017080132b30d519e +v8.9.1-nightly20171104a815e1b6a2 Carbon * +v9.0.0-nightly20171001f9be5fe52a +v9.5.1-nightly2018020181da708f73 +v9.7.1-nightly201803013f3995b7b7 +v9.9.1-nightly201803256591d9f761 +v10.0.0-nightly20180401141be923f3 +v10.5.1-nightly20180701b28fd37a69 +v10.7.1-nightly2018080162fd84528e +v10.9.0-nightly20180906707a37f74f +v10.15.3-nightly20190301156e4c8e89 Dubnium +v10.15.4-nightly201905019101d9368f Dubnium +v10.16.2-nightly20190801f025f8524b Dubnium * +v11.0.0-nightly201810011be804d625 +v11.1.0-nightly20181101af6d26281f +v12.0.0-nightly2019040166b95362df +v12.22.10-nightly2022012660c9d3bb95 Erbium * +v13.0.0-nightly2019100116e47b976b +v13.2.1-nightly20191201cbd50262c0 +v13.9.1-nightly202003041bca7b6c70 +v13.12.1-nightly20200401ffdd82ba3f +v14.0.0-nightly20200421c3554307c6 +v15.0.0-nightly2020102011f1ad939f +v16.0.0-nightly20210420a0261d231c +v17.0.0-nightly2021100135dc3861cd +v17.5.0-nightly20220209e43808936a +v18.0.0-nightly20220419bde889bd4e +v19.0.0-nightly202210182672219b78 +v20.0.0-nightly2023041197d3912eb8 +v20.7.0-nightly202309173557c436181c526f41bb6ce7751e63f36695aa1d +v21.0.0-nightly202310240fb512344f +v22.0.0-nightly20231025d1ccca9d2b diff --git a/test/fast/Unit tests/mocks/nvm_ls_remotestable nightly.txt b/test/fast/Unit tests/mocks/nvm_ls_remotestable nightly.txt new file mode 100644 index 0000000..95e94bb --- /dev/null +++ b/test/fast/Unit tests/mocks/nvm_ls_remotestable nightly.txt @@ -0,0 +1 @@ +v22.0.0-nightly20231025d1ccca9d2b diff --git a/test/fast/Unit tests/mocks/nvm_ls_remotestable.txt b/test/fast/Unit tests/mocks/nvm_ls_remotestable.txt new file mode 100644 index 0000000..f4801a0 --- /dev/null +++ b/test/fast/Unit tests/mocks/nvm_ls_remotestable.txt @@ -0,0 +1 @@ +v21.1.0 diff --git a/test/fast/Unit tests/mocks/nvm_make_aliasLTS alias calls.txt b/test/fast/Unit tests/mocks/nvm_make_aliasLTS alias calls.txt new file mode 100644 index 0000000..c152644 --- /dev/null +++ b/test/fast/Unit tests/mocks/nvm_make_aliasLTS alias calls.txt @@ -0,0 +1,10 @@ +lts/*|lts/iron +lts/iron|v20.9.0 +lts/hydrogen|v18.18.2 +lts/gallium|v16.20.2 +lts/fermium|v14.21.3 +lts/erbium|v12.22.12 +lts/dubnium|v10.24.1 +lts/carbon|v8.17.0 +lts/boron|v6.17.1 +lts/argon|v4.9.1 diff --git a/test/fast/Unit tests/mocks/nvm_print_implicit_aliasremote stable nightly.txt b/test/fast/Unit tests/mocks/nvm_print_implicit_aliasremote stable nightly.txt new file mode 100644 index 0000000..b090fe5 --- /dev/null +++ b/test/fast/Unit tests/mocks/nvm_print_implicit_aliasremote stable nightly.txt @@ -0,0 +1 @@ +22.0 diff --git a/test/fast/Unit tests/mocks/nvm_print_implicit_aliasremote stable.txt b/test/fast/Unit tests/mocks/nvm_print_implicit_aliasremote stable.txt new file mode 100644 index 0000000..ea8c92a --- /dev/null +++ b/test/fast/Unit tests/mocks/nvm_print_implicit_aliasremote stable.txt @@ -0,0 +1 @@ +21.1 diff --git a/test/fast/Unit tests/mocks/nvmls-remote iojs.txt b/test/fast/Unit tests/mocks/nvmls-remote iojs.txt new file mode 100644 index 0000000..5f2e598 --- /dev/null +++ b/test/fast/Unit tests/mocks/nvmls-remote iojs.txt @@ -0,0 +1,41 @@ + iojs-v1.0.0 + iojs-v1.0.1 + iojs-v1.0.2 + iojs-v1.0.3 + iojs-v1.0.4 + iojs-v1.1.0 + iojs-v1.2.0 + iojs-v1.3.0 + iojs-v1.4.1 + iojs-v1.4.2 + iojs-v1.4.3 + iojs-v1.5.0 + iojs-v1.5.1 + iojs-v1.6.0 + iojs-v1.6.1 + iojs-v1.6.2 + iojs-v1.6.3 + iojs-v1.6.4 + iojs-v1.7.1 + iojs-v1.8.1 + iojs-v1.8.2 + iojs-v1.8.3 + iojs-v1.8.4 + iojs-v2.0.0 + iojs-v2.0.1 + iojs-v2.0.2 + iojs-v2.1.0 + iojs-v2.2.0 + iojs-v2.2.1 + iojs-v2.3.0 + iojs-v2.3.1 + iojs-v2.3.2 + iojs-v2.3.3 + iojs-v2.3.4 + iojs-v2.4.0 + iojs-v2.5.0 + iojs-v3.0.0 + iojs-v3.1.0 + iojs-v3.2.0 + iojs-v3.3.0 + iojs-v3.3.1 diff --git a/test/fast/Unit tests/mocks/nvmls-remote lts.txt b/test/fast/Unit tests/mocks/nvmls-remote lts.txt new file mode 100644 index 0000000..a75df2e --- /dev/null +++ b/test/fast/Unit tests/mocks/nvmls-remote lts.txt @@ -0,0 +1,212 @@ + v4.2.0  (LTS: Argon) + v4.2.1  (LTS: Argon) + v4.2.2  (LTS: Argon) + v4.2.3  (LTS: Argon) + v4.2.4  (LTS: Argon) + v4.2.5  (LTS: Argon) + v4.2.6  (LTS: Argon) + v4.3.0  (LTS: Argon) + v4.3.1  (LTS: Argon) + v4.3.2  (LTS: Argon) + v4.4.0  (LTS: Argon) + v4.4.1  (LTS: Argon) + v4.4.2  (LTS: Argon) + v4.4.3  (LTS: Argon) + v4.4.4  (LTS: Argon) + v4.4.5  (LTS: Argon) + v4.4.6  (LTS: Argon) + v4.4.7  (LTS: Argon) + v4.5.0  (LTS: Argon) + v4.6.0  (LTS: Argon) + v4.6.1  (LTS: Argon) + v4.6.2  (LTS: Argon) + v4.7.0  (LTS: Argon) + v4.7.1  (LTS: Argon) + v4.7.2  (LTS: Argon) + v4.7.3  (LTS: Argon) + v4.8.0  (LTS: Argon) + v4.8.1  (LTS: Argon) + v4.8.2  (LTS: Argon) + v4.8.3  (LTS: Argon) + v4.8.4  (LTS: Argon) + v4.8.5  (LTS: Argon) + v4.8.6  (LTS: Argon) + v4.8.7  (LTS: Argon) + v4.9.0  (LTS: Argon) + v4.9.1  (Latest LTS: Argon) + v6.9.0  (LTS: Boron) + v6.9.1  (LTS: Boron) + v6.9.2  (LTS: Boron) + v6.9.3  (LTS: Boron) + v6.9.4  (LTS: Boron) + v6.9.5  (LTS: Boron) + v6.10.0  (LTS: Boron) + v6.10.1  (LTS: Boron) + v6.10.2  (LTS: Boron) + v6.10.3  (LTS: Boron) + v6.11.0  (LTS: Boron) + v6.11.1  (LTS: Boron) + v6.11.2  (LTS: Boron) + v6.11.3  (LTS: Boron) + v6.11.4  (LTS: Boron) + v6.11.5  (LTS: Boron) + v6.12.0  (LTS: Boron) + v6.12.1  (LTS: Boron) + v6.12.2  (LTS: Boron) + v6.12.3  (LTS: Boron) + v6.13.0  (LTS: Boron) + v6.13.1  (LTS: Boron) + v6.14.0  (LTS: Boron) + v6.14.1  (LTS: Boron) + v6.14.2  (LTS: Boron) + v6.14.3  (LTS: Boron) + v6.14.4  (LTS: Boron) + v6.15.0  (LTS: Boron) + v6.15.1  (LTS: Boron) + v6.16.0  (LTS: Boron) + v6.17.0  (LTS: Boron) + v6.17.1  (Latest LTS: Boron) + v8.9.0  (LTS: Carbon) + v8.9.1  (LTS: Carbon) + v8.9.2  (LTS: Carbon) + v8.9.3  (LTS: Carbon) + v8.9.4  (LTS: Carbon) + v8.10.0  (LTS: Carbon) + v8.11.0  (LTS: Carbon) + v8.11.1  (LTS: Carbon) + v8.11.2  (LTS: Carbon) + v8.11.3  (LTS: Carbon) + v8.11.4  (LTS: Carbon) + v8.12.0  (LTS: Carbon) + v8.13.0  (LTS: Carbon) + v8.14.0  (LTS: Carbon) + v8.14.1  (LTS: Carbon) + v8.15.0  (LTS: Carbon) + v8.15.1  (LTS: Carbon) + v8.16.0  (LTS: Carbon) + v8.16.1  (LTS: Carbon) + v8.16.2  (LTS: Carbon) + v8.17.0  (Latest LTS: Carbon) + v10.13.0  (LTS: Dubnium) + v10.14.0  (LTS: Dubnium) + v10.14.1  (LTS: Dubnium) + v10.14.2  (LTS: Dubnium) + v10.15.0  (LTS: Dubnium) + v10.15.1  (LTS: Dubnium) + v10.15.2  (LTS: Dubnium) + v10.15.3  (LTS: Dubnium) + v10.16.0  (LTS: Dubnium) + v10.16.1  (LTS: Dubnium) + v10.16.2  (LTS: Dubnium) + v10.16.3  (LTS: Dubnium) + v10.17.0  (LTS: Dubnium) + v10.18.0  (LTS: Dubnium) + v10.18.1  (LTS: Dubnium) + v10.19.0  (LTS: Dubnium) + v10.20.0  (LTS: Dubnium) + v10.20.1  (LTS: Dubnium) + v10.21.0  (LTS: Dubnium) + v10.22.0  (LTS: Dubnium) + v10.22.1  (LTS: Dubnium) + v10.23.0  (LTS: Dubnium) + v10.23.1  (LTS: Dubnium) + v10.23.2  (LTS: Dubnium) + v10.23.3  (LTS: Dubnium) + v10.24.0  (LTS: Dubnium) + v10.24.1  (Latest LTS: Dubnium) + v12.13.0  (LTS: Erbium) + v12.13.1  (LTS: Erbium) + v12.14.0  (LTS: Erbium) + v12.14.1  (LTS: Erbium) + v12.15.0  (LTS: Erbium) + v12.16.0  (LTS: Erbium) + v12.16.1  (LTS: Erbium) + v12.16.2  (LTS: Erbium) + v12.16.3  (LTS: Erbium) + v12.17.0  (LTS: Erbium) + v12.18.0  (LTS: Erbium) + v12.18.1  (LTS: Erbium) + v12.18.2  (LTS: Erbium) + v12.18.3  (LTS: Erbium) + v12.18.4  (LTS: Erbium) + v12.19.0  (LTS: Erbium) + v12.19.1  (LTS: Erbium) + v12.20.0  (LTS: Erbium) + v12.20.1  (LTS: Erbium) + v12.20.2  (LTS: Erbium) + v12.21.0  (LTS: Erbium) + v12.22.0  (LTS: Erbium) + v12.22.1  (LTS: Erbium) + v12.22.2  (LTS: Erbium) + v12.22.3  (LTS: Erbium) + v12.22.4  (LTS: Erbium) + v12.22.5  (LTS: Erbium) + v12.22.6  (LTS: Erbium) + v12.22.7  (LTS: Erbium) + v12.22.8  (LTS: Erbium) + v12.22.9  (LTS: Erbium) + v12.22.10  (LTS: Erbium) + v12.22.11  (LTS: Erbium) + v12.22.12  (Latest LTS: Erbium) + v14.15.0  (LTS: Fermium) + v14.15.1  (LTS: Fermium) + v14.15.2  (LTS: Fermium) + v14.15.3  (LTS: Fermium) + v14.15.4  (LTS: Fermium) + v14.15.5  (LTS: Fermium) + v14.16.0  (LTS: Fermium) + v14.16.1  (LTS: Fermium) + v14.17.0  (LTS: Fermium) + v14.17.1  (LTS: Fermium) + v14.17.2  (LTS: Fermium) + v14.17.3  (LTS: Fermium) + v14.17.4  (LTS: Fermium) + v14.17.5  (LTS: Fermium) + v14.17.6  (LTS: Fermium) + v14.18.0  (LTS: Fermium) + v14.18.1  (LTS: Fermium) + v14.18.2  (LTS: Fermium) + v14.18.3  (LTS: Fermium) + v14.19.0  (LTS: Fermium) + v14.19.1  (LTS: Fermium) + v14.19.2  (LTS: Fermium) + v14.19.3  (LTS: Fermium) + v14.20.0  (LTS: Fermium) + v14.20.1  (LTS: Fermium) + v14.21.0  (LTS: Fermium) + v14.21.1  (LTS: Fermium) + v14.21.2  (LTS: Fermium) + v14.21.3  (Latest LTS: Fermium) + v16.13.0  (LTS: Gallium) + v16.13.1  (LTS: Gallium) + v16.13.2  (LTS: Gallium) + v16.14.0  (LTS: Gallium) + v16.14.1  (LTS: Gallium) + v16.14.2  (LTS: Gallium) + v16.15.0  (LTS: Gallium) + v16.15.1  (LTS: Gallium) + v16.16.0  (LTS: Gallium) + v16.17.0  (LTS: Gallium) + v16.17.1  (LTS: Gallium) + v16.18.0  (LTS: Gallium) + v16.18.1  (LTS: Gallium) + v16.19.0  (LTS: Gallium) + v16.19.1  (LTS: Gallium) + v16.20.0  (LTS: Gallium) + v16.20.1  (LTS: Gallium) + v16.20.2  (Latest LTS: Gallium) + v18.12.0  (LTS: Hydrogen) + v18.12.1  (LTS: Hydrogen) + v18.13.0  (LTS: Hydrogen) + v18.14.0  (LTS: Hydrogen) + v18.14.1  (LTS: Hydrogen) + v18.14.2  (LTS: Hydrogen) + v18.15.0  (LTS: Hydrogen) + v18.16.0  (LTS: Hydrogen) + v18.16.1  (LTS: Hydrogen) + v18.17.0  (LTS: Hydrogen) + v18.17.1  (LTS: Hydrogen) + v18.18.0  (LTS: Hydrogen) + v18.18.1  (LTS: Hydrogen) + v18.18.2  (Latest LTS: Hydrogen) + v20.9.0  (Latest LTS: Iron) diff --git a/test/fast/Unit tests/mocks/nvmls-remote node.txt b/test/fast/Unit tests/mocks/nvmls-remote node.txt new file mode 100644 index 0000000..01e205a --- /dev/null +++ b/test/fast/Unit tests/mocks/nvmls-remote node.txt @@ -0,0 +1,711 @@ + v0.1.14 + v0.1.15 + v0.1.16 + v0.1.17 + v0.1.18 + v0.1.19 + v0.1.20 + v0.1.21 + v0.1.22 + v0.1.23 + v0.1.24 + v0.1.25 + v0.1.26 + v0.1.27 + v0.1.28 + v0.1.29 + v0.1.30 + v0.1.31 + v0.1.32 + v0.1.33 + v0.1.90 + v0.1.91 + v0.1.92 + v0.1.93 + v0.1.94 + v0.1.95 + v0.1.96 + v0.1.97 + v0.1.98 + v0.1.99 + v0.1.100 + v0.1.101 + v0.1.102 + v0.1.103 + v0.1.104 + v0.2.0 + v0.2.1 + v0.2.2 + v0.2.3 + v0.2.4 + v0.2.5 + v0.2.6 + v0.3.0 + v0.3.1 + v0.3.2 + v0.3.3 + v0.3.4 + v0.3.5 + v0.3.6 + v0.3.7 + v0.3.8 + v0.4.0 + v0.4.1 + v0.4.2 + v0.4.3 + v0.4.4 + v0.4.5 + v0.4.6 + v0.4.7 + v0.4.8 + v0.4.9 + v0.4.10 + v0.4.11 + v0.4.12 + v0.5.0 + v0.5.1 + v0.5.2 + v0.5.3 + v0.5.4 + v0.5.5 + v0.5.6 + v0.5.7 + v0.5.8 + v0.5.9 + v0.5.10 + v0.6.0 + v0.6.1 + v0.6.2 + v0.6.3 + v0.6.4 + v0.6.5 + v0.6.6 + v0.6.7 + v0.6.8 + v0.6.9 + v0.6.10 + v0.6.11 + v0.6.12 + v0.6.13 + v0.6.14 + v0.6.15 + v0.6.16 + v0.6.17 + v0.6.18 + v0.6.19 + v0.6.20 + v0.6.21 + v0.7.0 + v0.7.1 + v0.7.2 + v0.7.3 + v0.7.4 + v0.7.5 + v0.7.6 + v0.7.7 + v0.7.8 + v0.7.9 + v0.7.10 + v0.7.11 + v0.7.12 + v0.8.0 + v0.8.1 + v0.8.2 + v0.8.3 + v0.8.4 + v0.8.5 + v0.8.6 + v0.8.7 + v0.8.8 + v0.8.9 + v0.8.10 + v0.8.11 + v0.8.12 + v0.8.13 + v0.8.14 + v0.8.15 + v0.8.16 + v0.8.17 + v0.8.18 + v0.8.19 + v0.8.20 + v0.8.21 + v0.8.22 + v0.8.23 + v0.8.24 + v0.8.25 + v0.8.26 + v0.8.27 + v0.8.28 + v0.9.0 + v0.9.1 + v0.9.2 + v0.9.3 + v0.9.4 + v0.9.5 + v0.9.6 + v0.9.7 + v0.9.8 + v0.9.9 + v0.9.10 + v0.9.11 + v0.9.12 + v0.10.0 + v0.10.1 + v0.10.2 + v0.10.3 + v0.10.4 + v0.10.5 + v0.10.6 + v0.10.7 + v0.10.8 + v0.10.9 + v0.10.10 + v0.10.11 + v0.10.12 + v0.10.13 + v0.10.14 + v0.10.15 + v0.10.16 + v0.10.17 + v0.10.18 + v0.10.19 + v0.10.20 + v0.10.21 + v0.10.22 + v0.10.23 + v0.10.24 + v0.10.25 + v0.10.26 + v0.10.27 + v0.10.28 + v0.10.29 + v0.10.30 + v0.10.31 + v0.10.32 + v0.10.33 + v0.10.34 + v0.10.35 + v0.10.36 + v0.10.37 + v0.10.38 + v0.10.39 + v0.10.40 + v0.10.41 + v0.10.42 + v0.10.43 + v0.10.44 + v0.10.45 + v0.10.46 + v0.10.47 + v0.10.48 + v0.11.0 + v0.11.1 + v0.11.2 + v0.11.3 + v0.11.4 + v0.11.5 + v0.11.6 + v0.11.7 + v0.11.8 + v0.11.9 + v0.11.10 + v0.11.11 + v0.11.12 + v0.11.13 + v0.11.14 + v0.11.15 + v0.11.16 + v0.12.0 + v0.12.1 + v0.12.2 + v0.12.3 + v0.12.4 + v0.12.5 + v0.12.6 + v0.12.7 + v0.12.8 + v0.12.9 + v0.12.10 + v0.12.11 + v0.12.12 + v0.12.13 + v0.12.14 + v0.12.15 + v0.12.16 + v0.12.17 + v0.12.18 + v4.0.0 + v4.1.0 + v4.1.1 + v4.1.2 + v4.2.0  (LTS: Argon) + v4.2.1  (LTS: Argon) + v4.2.2  (LTS: Argon) + v4.2.3  (LTS: Argon) + v4.2.4  (LTS: Argon) + v4.2.5  (LTS: Argon) + v4.2.6  (LTS: Argon) + v4.3.0  (LTS: Argon) + v4.3.1  (LTS: Argon) + v4.3.2  (LTS: Argon) + v4.4.0  (LTS: Argon) + v4.4.1  (LTS: Argon) + v4.4.2  (LTS: Argon) + v4.4.3  (LTS: Argon) + v4.4.4  (LTS: Argon) + v4.4.5  (LTS: Argon) + v4.4.6  (LTS: Argon) + v4.4.7  (LTS: Argon) + v4.5.0  (LTS: Argon) + v4.6.0  (LTS: Argon) + v4.6.1  (LTS: Argon) + v4.6.2  (LTS: Argon) + v4.7.0  (LTS: Argon) + v4.7.1  (LTS: Argon) + v4.7.2  (LTS: Argon) + v4.7.3  (LTS: Argon) + v4.8.0  (LTS: Argon) + v4.8.1  (LTS: Argon) + v4.8.2  (LTS: Argon) + v4.8.3  (LTS: Argon) + v4.8.4  (LTS: Argon) + v4.8.5  (LTS: Argon) + v4.8.6  (LTS: Argon) + v4.8.7  (LTS: Argon) + v4.9.0  (LTS: Argon) + v4.9.1  (Latest LTS: Argon) + v5.0.0 + v5.1.0 + v5.1.1 + v5.2.0 + v5.3.0 + v5.4.0 + v5.4.1 + v5.5.0 + v5.6.0 + v5.7.0 + v5.7.1 + v5.8.0 + v5.9.0 + v5.9.1 + v5.10.0 + v5.10.1 + v5.11.0 + v5.11.1 + v5.12.0 + v6.0.0 + v6.1.0 + v6.2.0 + v6.2.1 + v6.2.2 + v6.3.0 + v6.3.1 + v6.4.0 + v6.5.0 + v6.6.0 + v6.7.0 + v6.8.0 + v6.8.1 + v6.9.0  (LTS: Boron) + v6.9.1  (LTS: Boron) + v6.9.2  (LTS: Boron) + v6.9.3  (LTS: Boron) + v6.9.4  (LTS: Boron) + v6.9.5  (LTS: Boron) + v6.10.0  (LTS: Boron) + v6.10.1  (LTS: Boron) + v6.10.2  (LTS: Boron) + v6.10.3  (LTS: Boron) + v6.11.0  (LTS: Boron) + v6.11.1  (LTS: Boron) + v6.11.2  (LTS: Boron) + v6.11.3  (LTS: Boron) + v6.11.4  (LTS: Boron) + v6.11.5  (LTS: Boron) + v6.12.0  (LTS: Boron) + v6.12.1  (LTS: Boron) + v6.12.2  (LTS: Boron) + v6.12.3  (LTS: Boron) + v6.13.0  (LTS: Boron) + v6.13.1  (LTS: Boron) + v6.14.0  (LTS: Boron) + v6.14.1  (LTS: Boron) + v6.14.2  (LTS: Boron) + v6.14.3  (LTS: Boron) + v6.14.4  (LTS: Boron) + v6.15.0  (LTS: Boron) + v6.15.1  (LTS: Boron) + v6.16.0  (LTS: Boron) + v6.17.0  (LTS: Boron) + v6.17.1  (Latest LTS: Boron) + v7.0.0 + v7.1.0 + v7.2.0 + v7.2.1 + v7.3.0 + v7.4.0 + v7.5.0 + v7.6.0 + v7.7.0 + v7.7.1 + v7.7.2 + v7.7.3 + v7.7.4 + v7.8.0 + v7.9.0 + v7.10.0 + v7.10.1 + v8.0.0 + v8.1.0 + v8.1.1 + v8.1.2 + v8.1.3 + v8.1.4 + v8.2.0 + v8.2.1 + v8.3.0 + v8.4.0 + v8.5.0 + v8.6.0 + v8.7.0 + v8.8.0 + v8.8.1 + v8.9.0  (LTS: Carbon) + v8.9.1  (LTS: Carbon) + v8.9.2  (LTS: Carbon) + v8.9.3  (LTS: Carbon) + v8.9.4  (LTS: Carbon) + v8.10.0  (LTS: Carbon) + v8.11.0  (LTS: Carbon) + v8.11.1  (LTS: Carbon) + v8.11.2  (LTS: Carbon) + v8.11.3  (LTS: Carbon) + v8.11.4  (LTS: Carbon) + v8.12.0  (LTS: Carbon) + v8.13.0  (LTS: Carbon) + v8.14.0  (LTS: Carbon) + v8.14.1  (LTS: Carbon) + v8.15.0  (LTS: Carbon) + v8.15.1  (LTS: Carbon) + v8.16.0  (LTS: Carbon) + v8.16.1  (LTS: Carbon) + v8.16.2  (LTS: Carbon) + v8.17.0  (Latest LTS: Carbon) + v9.0.0 + v9.1.0 + v9.2.0 + v9.2.1 + v9.3.0 + v9.4.0 + v9.5.0 + v9.6.0 + v9.6.1 + v9.7.0 + v9.7.1 + v9.8.0 + v9.9.0 + v9.10.0 + v9.10.1 + v9.11.0 + v9.11.1 + v9.11.2 + v10.0.0 + v10.1.0 + v10.2.0 + v10.2.1 + v10.3.0 + v10.4.0 + v10.4.1 + v10.5.0 + v10.6.0 + v10.7.0 + v10.8.0 + v10.9.0 + v10.10.0 + v10.11.0 + v10.12.0 + v10.13.0  (LTS: Dubnium) + v10.14.0  (LTS: Dubnium) + v10.14.1  (LTS: Dubnium) + v10.14.2  (LTS: Dubnium) + v10.15.0  (LTS: Dubnium) + v10.15.1  (LTS: Dubnium) + v10.15.2  (LTS: Dubnium) + v10.15.3  (LTS: Dubnium) + v10.16.0  (LTS: Dubnium) + v10.16.1  (LTS: Dubnium) + v10.16.2  (LTS: Dubnium) + v10.16.3  (LTS: Dubnium) + v10.17.0  (LTS: Dubnium) + v10.18.0  (LTS: Dubnium) + v10.18.1  (LTS: Dubnium) + v10.19.0  (LTS: Dubnium) + v10.20.0  (LTS: Dubnium) + v10.20.1  (LTS: Dubnium) + v10.21.0  (LTS: Dubnium) + v10.22.0  (LTS: Dubnium) + v10.22.1  (LTS: Dubnium) + v10.23.0  (LTS: Dubnium) + v10.23.1  (LTS: Dubnium) + v10.23.2  (LTS: Dubnium) + v10.23.3  (LTS: Dubnium) + v10.24.0  (LTS: Dubnium) + v10.24.1  (Latest LTS: Dubnium) + v11.0.0 + v11.1.0 + v11.2.0 + v11.3.0 + v11.4.0 + v11.5.0 + v11.6.0 + v11.7.0 + v11.8.0 + v11.9.0 + v11.10.0 + v11.10.1 + v11.11.0 + v11.12.0 + v11.13.0 + v11.14.0 + v11.15.0 + v12.0.0 + v12.1.0 + v12.2.0 + v12.3.0 + v12.3.1 + v12.4.0 + v12.5.0 + v12.6.0 + v12.7.0 + v12.8.0 + v12.8.1 + v12.9.0 + v12.9.1 + v12.10.0 + v12.11.0 + v12.11.1 + v12.12.0 + v12.13.0  (LTS: Erbium) + v12.13.1  (LTS: Erbium) + v12.14.0  (LTS: Erbium) + v12.14.1  (LTS: Erbium) + v12.15.0  (LTS: Erbium) + v12.16.0  (LTS: Erbium) + v12.16.1  (LTS: Erbium) + v12.16.2  (LTS: Erbium) + v12.16.3  (LTS: Erbium) + v12.17.0  (LTS: Erbium) + v12.18.0  (LTS: Erbium) + v12.18.1  (LTS: Erbium) + v12.18.2  (LTS: Erbium) + v12.18.3  (LTS: Erbium) + v12.18.4  (LTS: Erbium) + v12.19.0  (LTS: Erbium) + v12.19.1  (LTS: Erbium) + v12.20.0  (LTS: Erbium) + v12.20.1  (LTS: Erbium) + v12.20.2  (LTS: Erbium) + v12.21.0  (LTS: Erbium) + v12.22.0  (LTS: Erbium) + v12.22.1  (LTS: Erbium) + v12.22.2  (LTS: Erbium) + v12.22.3  (LTS: Erbium) + v12.22.4  (LTS: Erbium) + v12.22.5  (LTS: Erbium) + v12.22.6  (LTS: Erbium) + v12.22.7  (LTS: Erbium) + v12.22.8  (LTS: Erbium) + v12.22.9  (LTS: Erbium) + v12.22.10  (LTS: Erbium) + v12.22.11  (LTS: Erbium) + v12.22.12  (Latest LTS: Erbium) + v13.0.0 + v13.0.1 + v13.1.0 + v13.2.0 + v13.3.0 + v13.4.0 + v13.5.0 + v13.6.0 + v13.7.0 + v13.8.0 + v13.9.0 + v13.10.0 + v13.10.1 + v13.11.0 + v13.12.0 + v13.13.0 + v13.14.0 + v14.0.0 + v14.1.0 + v14.2.0 + v14.3.0 + v14.4.0 + v14.5.0 + v14.6.0 + v14.7.0 + v14.8.0 + v14.9.0 + v14.10.0 + v14.10.1 + v14.11.0 + v14.12.0 + v14.13.0 + v14.13.1 + v14.14.0 + v14.15.0  (LTS: Fermium) + v14.15.1  (LTS: Fermium) + v14.15.2  (LTS: Fermium) + v14.15.3  (LTS: Fermium) + v14.15.4  (LTS: Fermium) + v14.15.5  (LTS: Fermium) + v14.16.0  (LTS: Fermium) + v14.16.1  (LTS: Fermium) + v14.17.0  (LTS: Fermium) + v14.17.1  (LTS: Fermium) + v14.17.2  (LTS: Fermium) + v14.17.3  (LTS: Fermium) + v14.17.4  (LTS: Fermium) + v14.17.5  (LTS: Fermium) + v14.17.6  (LTS: Fermium) + v14.18.0  (LTS: Fermium) + v14.18.1  (LTS: Fermium) + v14.18.2  (LTS: Fermium) + v14.18.3  (LTS: Fermium) + v14.19.0  (LTS: Fermium) + v14.19.1  (LTS: Fermium) + v14.19.2  (LTS: Fermium) + v14.19.3  (LTS: Fermium) + v14.20.0  (LTS: Fermium) + v14.20.1  (LTS: Fermium) + v14.21.0  (LTS: Fermium) + v14.21.1  (LTS: Fermium) + v14.21.2  (LTS: Fermium) + v14.21.3  (Latest LTS: Fermium) + v15.0.0 + v15.0.1 + v15.1.0 + v15.2.0 + v15.2.1 + v15.3.0 + v15.4.0 + v15.5.0 + v15.5.1 + v15.6.0 + v15.7.0 + v15.8.0 + v15.9.0 + v15.10.0 + v15.11.0 + v15.12.0 + v15.13.0 + v15.14.0 + v16.0.0 + v16.1.0 + v16.2.0 + v16.3.0 + v16.4.0 + v16.4.1 + v16.4.2 + v16.5.0 + v16.6.0 + v16.6.1 + v16.6.2 + v16.7.0 + v16.8.0 + v16.9.0 + v16.9.1 + v16.10.0 + v16.11.0 + v16.11.1 + v16.12.0 + v16.13.0  (LTS: Gallium) + v16.13.1  (LTS: Gallium) + v16.13.2  (LTS: Gallium) + v16.14.0  (LTS: Gallium) + v16.14.1  (LTS: Gallium) + v16.14.2  (LTS: Gallium) + v16.15.0  (LTS: Gallium) + v16.15.1  (LTS: Gallium) + v16.16.0  (LTS: Gallium) + v16.17.0  (LTS: Gallium) + v16.17.1  (LTS: Gallium) + v16.18.0  (LTS: Gallium) + v16.18.1  (LTS: Gallium) + v16.19.0  (LTS: Gallium) + v16.19.1  (LTS: Gallium) + v16.20.0  (LTS: Gallium) + v16.20.1  (LTS: Gallium) + v16.20.2  (Latest LTS: Gallium) + v17.0.0 + v17.0.1 + v17.1.0 + v17.2.0 + v17.3.0 + v17.3.1 + v17.4.0 + v17.5.0 + v17.6.0 + v17.7.0 + v17.7.1 + v17.7.2 + v17.8.0 + v17.9.0 + v17.9.1 + v18.0.0 + v18.1.0 + v18.2.0 + v18.3.0 + v18.4.0 + v18.5.0 + v18.6.0 + v18.7.0 + v18.8.0 + v18.9.0 + v18.9.1 + v18.10.0 + v18.11.0 + v18.12.0  (LTS: Hydrogen) + v18.12.1  (LTS: Hydrogen) + v18.13.0  (LTS: Hydrogen) + v18.14.0  (LTS: Hydrogen) + v18.14.1  (LTS: Hydrogen) + v18.14.2  (LTS: Hydrogen) + v18.15.0  (LTS: Hydrogen) + v18.16.0  (LTS: Hydrogen) + v18.16.1  (LTS: Hydrogen) + v18.17.0  (LTS: Hydrogen) + v18.17.1  (LTS: Hydrogen) + v18.18.0  (LTS: Hydrogen) + v18.18.1  (LTS: Hydrogen) + v18.18.2  (Latest LTS: Hydrogen) + v19.0.0 + v19.0.1 + v19.1.0 + v19.2.0 + v19.3.0 + v19.4.0 + v19.5.0 + v19.6.0 + v19.6.1 + v19.7.0 + v19.8.0 + v19.8.1 + v19.9.0 + v20.0.0 + v20.1.0 + v20.2.0 + v20.3.0 + v20.3.1 + v20.4.0 + v20.5.0 + v20.5.1 + v20.6.0 + v20.6.1 + v20.7.0 + v20.8.0 + v20.8.1 + v20.9.0  (Latest LTS: Iron) + v21.0.0 + v21.1.0 diff --git a/test/fast/Unit tests/mocks/nvmls-remote.txt b/test/fast/Unit tests/mocks/nvmls-remote.txt new file mode 100644 index 0000000..28b0ef5 --- /dev/null +++ b/test/fast/Unit tests/mocks/nvmls-remote.txt @@ -0,0 +1,752 @@ + v0.1.14 + v0.1.15 + v0.1.16 + v0.1.17 + v0.1.18 + v0.1.19 + v0.1.20 + v0.1.21 + v0.1.22 + v0.1.23 + v0.1.24 + v0.1.25 + v0.1.26 + v0.1.27 + v0.1.28 + v0.1.29 + v0.1.30 + v0.1.31 + v0.1.32 + v0.1.33 + v0.1.90 + v0.1.91 + v0.1.92 + v0.1.93 + v0.1.94 + v0.1.95 + v0.1.96 + v0.1.97 + v0.1.98 + v0.1.99 + v0.1.100 + v0.1.101 + v0.1.102 + v0.1.103 + v0.1.104 + v0.2.0 + v0.2.1 + v0.2.2 + v0.2.3 + v0.2.4 + v0.2.5 + v0.2.6 + v0.3.0 + v0.3.1 + v0.3.2 + v0.3.3 + v0.3.4 + v0.3.5 + v0.3.6 + v0.3.7 + v0.3.8 + v0.4.0 + v0.4.1 + v0.4.2 + v0.4.3 + v0.4.4 + v0.4.5 + v0.4.6 + v0.4.7 + v0.4.8 + v0.4.9 + v0.4.10 + v0.4.11 + v0.4.12 + v0.5.0 + v0.5.1 + v0.5.2 + v0.5.3 + v0.5.4 + v0.5.5 + v0.5.6 + v0.5.7 + v0.5.8 + v0.5.9 + v0.5.10 + v0.6.0 + v0.6.1 + v0.6.2 + v0.6.3 + v0.6.4 + v0.6.5 + v0.6.6 + v0.6.7 + v0.6.8 + v0.6.9 + v0.6.10 + v0.6.11 + v0.6.12 + v0.6.13 + v0.6.14 + v0.6.15 + v0.6.16 + v0.6.17 + v0.6.18 + v0.6.19 + v0.6.20 + v0.6.21 + v0.7.0 + v0.7.1 + v0.7.2 + v0.7.3 + v0.7.4 + v0.7.5 + v0.7.6 + v0.7.7 + v0.7.8 + v0.7.9 + v0.7.10 + v0.7.11 + v0.7.12 + v0.8.0 + v0.8.1 + v0.8.2 + v0.8.3 + v0.8.4 + v0.8.5 + v0.8.6 + v0.8.7 + v0.8.8 + v0.8.9 + v0.8.10 + v0.8.11 + v0.8.12 + v0.8.13 + v0.8.14 + v0.8.15 + v0.8.16 + v0.8.17 + v0.8.18 + v0.8.19 + v0.8.20 + v0.8.21 + v0.8.22 + v0.8.23 + v0.8.24 + v0.8.25 + v0.8.26 + v0.8.27 + v0.8.28 + v0.9.0 + v0.9.1 + v0.9.2 + v0.9.3 + v0.9.4 + v0.9.5 + v0.9.6 + v0.9.7 + v0.9.8 + v0.9.9 + v0.9.10 + v0.9.11 + v0.9.12 + v0.10.0 + v0.10.1 + v0.10.2 + v0.10.3 + v0.10.4 + v0.10.5 + v0.10.6 + v0.10.7 + v0.10.8 + v0.10.9 + v0.10.10 + v0.10.11 + v0.10.12 + v0.10.13 + v0.10.14 + v0.10.15 + v0.10.16 + v0.10.17 + v0.10.18 + v0.10.19 + v0.10.20 + v0.10.21 + v0.10.22 + v0.10.23 + v0.10.24 + v0.10.25 + v0.10.26 + v0.10.27 + v0.10.28 + v0.10.29 + v0.10.30 + v0.10.31 + v0.10.32 + v0.10.33 + v0.10.34 + v0.10.35 + v0.10.36 + v0.10.37 + v0.10.38 + v0.10.39 + v0.10.40 + v0.10.41 + v0.10.42 + v0.10.43 + v0.10.44 + v0.10.45 + v0.10.46 + v0.10.47 + v0.10.48 + v0.11.0 + v0.11.1 + v0.11.2 + v0.11.3 + v0.11.4 + v0.11.5 + v0.11.6 + v0.11.7 + v0.11.8 + v0.11.9 + v0.11.10 + v0.11.11 + v0.11.12 + v0.11.13 + v0.11.14 + v0.11.15 + v0.11.16 + v0.12.0 + v0.12.1 + v0.12.2 + v0.12.3 + v0.12.4 + v0.12.5 + v0.12.6 + v0.12.7 + v0.12.8 + v0.12.9 + v0.12.10 + v0.12.11 + v0.12.12 + v0.12.13 + v0.12.14 + v0.12.15 + v0.12.16 + v0.12.17 + v0.12.18 + iojs-v1.0.0 + iojs-v1.0.1 + iojs-v1.0.2 + iojs-v1.0.3 + iojs-v1.0.4 + iojs-v1.1.0 + iojs-v1.2.0 + iojs-v1.3.0 + iojs-v1.4.1 + iojs-v1.4.2 + iojs-v1.4.3 + iojs-v1.5.0 + iojs-v1.5.1 + iojs-v1.6.0 + iojs-v1.6.1 + iojs-v1.6.2 + iojs-v1.6.3 + iojs-v1.6.4 + iojs-v1.7.1 + iojs-v1.8.1 + iojs-v1.8.2 + iojs-v1.8.3 + iojs-v1.8.4 + iojs-v2.0.0 + iojs-v2.0.1 + iojs-v2.0.2 + iojs-v2.1.0 + iojs-v2.2.0 + iojs-v2.2.1 + iojs-v2.3.0 + iojs-v2.3.1 + iojs-v2.3.2 + iojs-v2.3.3 + iojs-v2.3.4 + iojs-v2.4.0 + iojs-v2.5.0 + iojs-v3.0.0 + iojs-v3.1.0 + iojs-v3.2.0 + iojs-v3.3.0 + iojs-v3.3.1 + v4.0.0 + v4.1.0 + v4.1.1 + v4.1.2 + v4.2.0  (LTS: Argon) + v4.2.1  (LTS: Argon) + v4.2.2  (LTS: Argon) + v4.2.3  (LTS: Argon) + v4.2.4  (LTS: Argon) + v4.2.5  (LTS: Argon) + v4.2.6  (LTS: Argon) + v4.3.0  (LTS: Argon) + v4.3.1  (LTS: Argon) + v4.3.2  (LTS: Argon) + v4.4.0  (LTS: Argon) + v4.4.1  (LTS: Argon) + v4.4.2  (LTS: Argon) + v4.4.3  (LTS: Argon) + v4.4.4  (LTS: Argon) + v4.4.5  (LTS: Argon) + v4.4.6  (LTS: Argon) + v4.4.7  (LTS: Argon) + v4.5.0  (LTS: Argon) + v4.6.0  (LTS: Argon) + v4.6.1  (LTS: Argon) + v4.6.2  (LTS: Argon) + v4.7.0  (LTS: Argon) + v4.7.1  (LTS: Argon) + v4.7.2  (LTS: Argon) + v4.7.3  (LTS: Argon) + v4.8.0  (LTS: Argon) + v4.8.1  (LTS: Argon) + v4.8.2  (LTS: Argon) + v4.8.3  (LTS: Argon) + v4.8.4  (LTS: Argon) + v4.8.5  (LTS: Argon) + v4.8.6  (LTS: Argon) + v4.8.7  (LTS: Argon) + v4.9.0  (LTS: Argon) + v4.9.1  (Latest LTS: Argon) + v5.0.0 + v5.1.0 + v5.1.1 + v5.2.0 + v5.3.0 + v5.4.0 + v5.4.1 + v5.5.0 + v5.6.0 + v5.7.0 + v5.7.1 + v5.8.0 + v5.9.0 + v5.9.1 + v5.10.0 + v5.10.1 + v5.11.0 + v5.11.1 + v5.12.0 + v6.0.0 + v6.1.0 + v6.2.0 + v6.2.1 + v6.2.2 + v6.3.0 + v6.3.1 + v6.4.0 + v6.5.0 + v6.6.0 + v6.7.0 + v6.8.0 + v6.8.1 + v6.9.0  (LTS: Boron) + v6.9.1  (LTS: Boron) + v6.9.2  (LTS: Boron) + v6.9.3  (LTS: Boron) + v6.9.4  (LTS: Boron) + v6.9.5  (LTS: Boron) + v6.10.0  (LTS: Boron) + v6.10.1  (LTS: Boron) + v6.10.2  (LTS: Boron) + v6.10.3  (LTS: Boron) + v6.11.0  (LTS: Boron) + v6.11.1  (LTS: Boron) + v6.11.2  (LTS: Boron) + v6.11.3  (LTS: Boron) + v6.11.4  (LTS: Boron) + v6.11.5  (LTS: Boron) + v6.12.0  (LTS: Boron) + v6.12.1  (LTS: Boron) + v6.12.2  (LTS: Boron) + v6.12.3  (LTS: Boron) + v6.13.0  (LTS: Boron) + v6.13.1  (LTS: Boron) + v6.14.0  (LTS: Boron) + v6.14.1  (LTS: Boron) + v6.14.2  (LTS: Boron) + v6.14.3  (LTS: Boron) + v6.14.4  (LTS: Boron) + v6.15.0  (LTS: Boron) + v6.15.1  (LTS: Boron) + v6.16.0  (LTS: Boron) + v6.17.0  (LTS: Boron) + v6.17.1  (Latest LTS: Boron) + v7.0.0 + v7.1.0 + v7.2.0 + v7.2.1 + v7.3.0 + v7.4.0 + v7.5.0 + v7.6.0 + v7.7.0 + v7.7.1 + v7.7.2 + v7.7.3 + v7.7.4 + v7.8.0 + v7.9.0 + v7.10.0 + v7.10.1 + v8.0.0 + v8.1.0 + v8.1.1 + v8.1.2 + v8.1.3 + v8.1.4 + v8.2.0 + v8.2.1 + v8.3.0 + v8.4.0 + v8.5.0 + v8.6.0 + v8.7.0 + v8.8.0 + v8.8.1 + v8.9.0  (LTS: Carbon) + v8.9.1  (LTS: Carbon) + v8.9.2  (LTS: Carbon) + v8.9.3  (LTS: Carbon) + v8.9.4  (LTS: Carbon) + v8.10.0  (LTS: Carbon) + v8.11.0  (LTS: Carbon) + v8.11.1  (LTS: Carbon) + v8.11.2  (LTS: Carbon) + v8.11.3  (LTS: Carbon) + v8.11.4  (LTS: Carbon) + v8.12.0  (LTS: Carbon) + v8.13.0  (LTS: Carbon) + v8.14.0  (LTS: Carbon) + v8.14.1  (LTS: Carbon) + v8.15.0  (LTS: Carbon) + v8.15.1  (LTS: Carbon) + v8.16.0  (LTS: Carbon) + v8.16.1  (LTS: Carbon) + v8.16.2  (LTS: Carbon) + v8.17.0  (Latest LTS: Carbon) + v9.0.0 + v9.1.0 + v9.2.0 + v9.2.1 + v9.3.0 + v9.4.0 + v9.5.0 + v9.6.0 + v9.6.1 + v9.7.0 + v9.7.1 + v9.8.0 + v9.9.0 + v9.10.0 + v9.10.1 + v9.11.0 + v9.11.1 + v9.11.2 + v10.0.0 + v10.1.0 + v10.2.0 + v10.2.1 + v10.3.0 + v10.4.0 + v10.4.1 + v10.5.0 + v10.6.0 + v10.7.0 + v10.8.0 + v10.9.0 + v10.10.0 + v10.11.0 + v10.12.0 + v10.13.0  (LTS: Dubnium) + v10.14.0  (LTS: Dubnium) + v10.14.1  (LTS: Dubnium) + v10.14.2  (LTS: Dubnium) + v10.15.0  (LTS: Dubnium) + v10.15.1  (LTS: Dubnium) + v10.15.2  (LTS: Dubnium) + v10.15.3  (LTS: Dubnium) + v10.16.0  (LTS: Dubnium) + v10.16.1  (LTS: Dubnium) + v10.16.2  (LTS: Dubnium) + v10.16.3  (LTS: Dubnium) + v10.17.0  (LTS: Dubnium) + v10.18.0  (LTS: Dubnium) + v10.18.1  (LTS: Dubnium) + v10.19.0  (LTS: Dubnium) + v10.20.0  (LTS: Dubnium) + v10.20.1  (LTS: Dubnium) + v10.21.0  (LTS: Dubnium) + v10.22.0  (LTS: Dubnium) + v10.22.1  (LTS: Dubnium) + v10.23.0  (LTS: Dubnium) + v10.23.1  (LTS: Dubnium) + v10.23.2  (LTS: Dubnium) + v10.23.3  (LTS: Dubnium) + v10.24.0  (LTS: Dubnium) + v10.24.1  (Latest LTS: Dubnium) + v11.0.0 + v11.1.0 + v11.2.0 + v11.3.0 + v11.4.0 + v11.5.0 + v11.6.0 + v11.7.0 + v11.8.0 + v11.9.0 + v11.10.0 + v11.10.1 + v11.11.0 + v11.12.0 + v11.13.0 + v11.14.0 + v11.15.0 + v12.0.0 + v12.1.0 + v12.2.0 + v12.3.0 + v12.3.1 + v12.4.0 + v12.5.0 + v12.6.0 + v12.7.0 + v12.8.0 + v12.8.1 + v12.9.0 + v12.9.1 + v12.10.0 + v12.11.0 + v12.11.1 + v12.12.0 + v12.13.0  (LTS: Erbium) + v12.13.1  (LTS: Erbium) + v12.14.0  (LTS: Erbium) + v12.14.1  (LTS: Erbium) + v12.15.0  (LTS: Erbium) + v12.16.0  (LTS: Erbium) + v12.16.1  (LTS: Erbium) + v12.16.2  (LTS: Erbium) + v12.16.3  (LTS: Erbium) + v12.17.0  (LTS: Erbium) + v12.18.0  (LTS: Erbium) + v12.18.1  (LTS: Erbium) + v12.18.2  (LTS: Erbium) + v12.18.3  (LTS: Erbium) + v12.18.4  (LTS: Erbium) + v12.19.0  (LTS: Erbium) + v12.19.1  (LTS: Erbium) + v12.20.0  (LTS: Erbium) + v12.20.1  (LTS: Erbium) + v12.20.2  (LTS: Erbium) + v12.21.0  (LTS: Erbium) + v12.22.0  (LTS: Erbium) + v12.22.1  (LTS: Erbium) + v12.22.2  (LTS: Erbium) + v12.22.3  (LTS: Erbium) + v12.22.4  (LTS: Erbium) + v12.22.5  (LTS: Erbium) + v12.22.6  (LTS: Erbium) + v12.22.7  (LTS: Erbium) + v12.22.8  (LTS: Erbium) + v12.22.9  (LTS: Erbium) + v12.22.10  (LTS: Erbium) + v12.22.11  (LTS: Erbium) + v12.22.12  (Latest LTS: Erbium) + v13.0.0 + v13.0.1 + v13.1.0 + v13.2.0 + v13.3.0 + v13.4.0 + v13.5.0 + v13.6.0 + v13.7.0 + v13.8.0 + v13.9.0 + v13.10.0 + v13.10.1 + v13.11.0 + v13.12.0 + v13.13.0 + v13.14.0 + v14.0.0 + v14.1.0 + v14.2.0 + v14.3.0 + v14.4.0 + v14.5.0 + v14.6.0 + v14.7.0 + v14.8.0 + v14.9.0 + v14.10.0 + v14.10.1 + v14.11.0 + v14.12.0 + v14.13.0 + v14.13.1 + v14.14.0 + v14.15.0  (LTS: Fermium) + v14.15.1  (LTS: Fermium) + v14.15.2  (LTS: Fermium) + v14.15.3  (LTS: Fermium) + v14.15.4  (LTS: Fermium) + v14.15.5  (LTS: Fermium) + v14.16.0  (LTS: Fermium) + v14.16.1  (LTS: Fermium) + v14.17.0  (LTS: Fermium) + v14.17.1  (LTS: Fermium) + v14.17.2  (LTS: Fermium) + v14.17.3  (LTS: Fermium) + v14.17.4  (LTS: Fermium) + v14.17.5  (LTS: Fermium) + v14.17.6  (LTS: Fermium) + v14.18.0  (LTS: Fermium) + v14.18.1  (LTS: Fermium) + v14.18.2  (LTS: Fermium) + v14.18.3  (LTS: Fermium) + v14.19.0  (LTS: Fermium) + v14.19.1  (LTS: Fermium) + v14.19.2  (LTS: Fermium) + v14.19.3  (LTS: Fermium) + v14.20.0  (LTS: Fermium) + v14.20.1  (LTS: Fermium) + v14.21.0  (LTS: Fermium) + v14.21.1  (LTS: Fermium) + v14.21.2  (LTS: Fermium) + v14.21.3  (Latest LTS: Fermium) + v15.0.0 + v15.0.1 + v15.1.0 + v15.2.0 + v15.2.1 + v15.3.0 + v15.4.0 + v15.5.0 + v15.5.1 + v15.6.0 + v15.7.0 + v15.8.0 + v15.9.0 + v15.10.0 + v15.11.0 + v15.12.0 + v15.13.0 + v15.14.0 + v16.0.0 + v16.1.0 + v16.2.0 + v16.3.0 + v16.4.0 + v16.4.1 + v16.4.2 + v16.5.0 + v16.6.0 + v16.6.1 + v16.6.2 + v16.7.0 + v16.8.0 + v16.9.0 + v16.9.1 + v16.10.0 + v16.11.0 + v16.11.1 + v16.12.0 + v16.13.0  (LTS: Gallium) + v16.13.1  (LTS: Gallium) + v16.13.2  (LTS: Gallium) + v16.14.0  (LTS: Gallium) + v16.14.1  (LTS: Gallium) + v16.14.2  (LTS: Gallium) + v16.15.0  (LTS: Gallium) + v16.15.1  (LTS: Gallium) + v16.16.0  (LTS: Gallium) + v16.17.0  (LTS: Gallium) + v16.17.1  (LTS: Gallium) + v16.18.0  (LTS: Gallium) + v16.18.1  (LTS: Gallium) + v16.19.0  (LTS: Gallium) + v16.19.1  (LTS: Gallium) + v16.20.0  (LTS: Gallium) + v16.20.1  (LTS: Gallium) + v16.20.2  (Latest LTS: Gallium) + v17.0.0 + v17.0.1 + v17.1.0 + v17.2.0 + v17.3.0 + v17.3.1 + v17.4.0 + v17.5.0 + v17.6.0 + v17.7.0 + v17.7.1 + v17.7.2 + v17.8.0 + v17.9.0 + v17.9.1 + v18.0.0 + v18.1.0 + v18.2.0 + v18.3.0 + v18.4.0 + v18.5.0 + v18.6.0 + v18.7.0 + v18.8.0 + v18.9.0 + v18.9.1 + v18.10.0 + v18.11.0 + v18.12.0  (LTS: Hydrogen) + v18.12.1  (LTS: Hydrogen) + v18.13.0  (LTS: Hydrogen) + v18.14.0  (LTS: Hydrogen) + v18.14.1  (LTS: Hydrogen) + v18.14.2  (LTS: Hydrogen) + v18.15.0  (LTS: Hydrogen) + v18.16.0  (LTS: Hydrogen) + v18.16.1  (LTS: Hydrogen) + v18.17.0  (LTS: Hydrogen) + v18.17.1  (LTS: Hydrogen) + v18.18.0  (LTS: Hydrogen) + v18.18.1  (LTS: Hydrogen) + v18.18.2  (Latest LTS: Hydrogen) + v19.0.0 + v19.0.1 + v19.1.0 + v19.2.0 + v19.3.0 + v19.4.0 + v19.5.0 + v19.6.0 + v19.6.1 + v19.7.0 + v19.8.0 + v19.8.1 + v19.9.0 + v20.0.0 + v20.1.0 + v20.2.0 + v20.3.0 + v20.3.1 + v20.4.0 + v20.5.0 + v20.5.1 + v20.6.0 + v20.6.1 + v20.7.0 + v20.8.0 + v20.8.1 + v20.9.0  (Latest LTS: Iron) + v21.0.0 + v21.1.0 diff --git a/test/fast/Unit tests/nvm ls-remote b/test/fast/Unit tests/nvm ls-remote old mode 100755 new mode 100644 diff --git a/test/fast/Unit tests/nvm set_colors b/test/fast/Unit tests/nvm set_colors old mode 100755 new mode 100644 diff --git a/test/fast/Unit tests/nvm version-remote b/test/fast/Unit tests/nvm version-remote old mode 100755 new mode 100644 diff --git a/test/fast/Unit tests/nvm_alias LTS-N b/test/fast/Unit tests/nvm_alias LTS-N old mode 100755 new mode 100644 diff --git a/test/fast/Unit tests/nvm_aliasLTS-N b/test/fast/Unit tests/nvm_aliasLTS-N new file mode 100644 index 0000000..b110117 --- /dev/null +++ b/test/fast/Unit tests/nvm_aliasLTS-N @@ -0,0 +1,36 @@ +#!/bin/sh + +die () { echo "$@" ; cleanup ; exit 1; } + + +cleanup() { + unset -f nvm_download +} + +\. ../../../nvm.sh + +set -ex + +MOCKS_DIR="${PWD}/mocks" + +# sample output at the time the test was written +TAB_PATH="${MOCKS_DIR}/nodejs.org-dist-index.tab" +nvm_download() { + cat "${TAB_PATH}" +} + +nvm_ls_remote >/dev/null || die "nvm_ls_remote_failed?!" + +LTS_NAMES_PATH="${MOCKS_DIR}/LTS_names.txt" + +N=0 +while IFS= read -r LTS; do + if [ $N -gt 0 ]; then + EXPECTED="$(nvm_alias "lts/${LTS}")" + ACTUAL="$(nvm_alias "lts/-${N}")" + [ "${EXPECTED}" = "${ACTUAL}" ] || die "\`nvm_alias lts/-${N}\` was \`${ACTUAL}\`; expected \`${EXPECTED}\`" + fi + N=$(($N+1)) +done < "${LTS_NAMES_PATH}" + +cleanup diff --git a/test/fast/Unit tests/nvm_get_latest missing curl or wget b/test/fast/Unit tests/nvm_get_latest missing curl or wget old mode 100755 new mode 100644 diff --git a/test/fast/Unit tests/nvm_get_latestmissing curl or wget b/test/fast/Unit tests/nvm_get_latestmissing curl or wget new file mode 100644 index 0000000..2c9b1da --- /dev/null +++ b/test/fast/Unit tests/nvm_get_latestmissing curl or wget @@ -0,0 +1,20 @@ +#!/bin/sh + +die () { echo "$@" ; cleanup ; exit 1; } + +cleanup() { + unset -f nvm_has +} + +\. ../../../nvm.sh + +nvm_has() { return 1 ; } + +OUTPUT="$(nvm_get_latest 2>&1)" +EXIT_CODE="$(nvm_get_latest >/dev/null 2>&1 ; echo $?)" +[ "_$OUTPUT" = "_nvm needs curl or wget to proceed." ] \ + || die "no curl/wget did not report correct error message, got '$OUTPUT'" +[ "_$EXIT_CODE" = "_1" ] \ + || die "no curl/wget did not exit with code 1, got $EXIT_CODE" + +cleanup diff --git a/test/fast/Unit tests/nvm_ls_remote LTS aliases b/test/fast/Unit tests/nvm_ls_remote LTS aliases old mode 100755 new mode 100644 diff --git a/test/fast/Unit tests/nvm_ls_remote nightly b/test/fast/Unit tests/nvm_ls_remote nightly old mode 100755 new mode 100644 diff --git a/test/fast/Unit tests/nvm_ls_remoteLTS aliases b/test/fast/Unit tests/nvm_ls_remoteLTS aliases new file mode 100644 index 0000000..e03cb99 --- /dev/null +++ b/test/fast/Unit tests/nvm_ls_remoteLTS aliases @@ -0,0 +1,49 @@ +#!/bin/sh + +die () { echo "$@" ; cleanup ; exit 1; } + +TEST_PATH="$PWD/test_output" +mkdir -p "$TEST_PATH" +CALL_COUNT_PATH="$TEST_PATH/call_count.txt" +: > "$CALL_COUNT_PATH" +ALIAS_ARGS_PATH="$TEST_PATH/nvm_make_alias_args.txt" +: > "$ALIAS_ARGS_PATH" + +cleanup() { + unset -f nvm_download nvm_make_alias + rm -rf "$TEST_PATH" +} + +\. ../../../nvm.sh + +set -ex + +MOCKS_DIR="$PWD/mocks" + +# sample output at the time the test was written +TAB_PATH="$MOCKS_DIR/nodejs.org-dist-index.tab" +nvm_download() { + cat "$TAB_PATH" +} + +nvm_make_alias() { + CALL_COUNT="$(cat "$CALL_COUNT_PATH")" + CALL_COUNT="$((CALL_COUNT + 1))" + echo "$CALL_COUNT" > "$CALL_COUNT_PATH" + echo "${1}|${2}" >> "$ALIAS_ARGS_PATH" +} + +nvm_ls_remote >/dev/null || die "nvm_ls_remote_failed?!" + +CALL_COUNT="$(cat "$CALL_COUNT_PATH")" + +LTS_LINES="$(cat "${MOCKS_DIR}/LTS_names.txt" | wc -l)" +EXPECTED_COUNT="$((LTS_LINES + 1))" +[ "$CALL_COUNT" = "$EXPECTED_COUNT" ] || die "nvm_make_alias called $CALL_COUNT times; expected $EXPECTED_COUNT" + +ARGS="$(cat "$ALIAS_ARGS_PATH")" +EXPECTED_ARGS_PATH="$MOCKS_DIR/nvm_make_alias LTS alias calls.txt" +EXPECTED_ARGS="$(cat "$EXPECTED_ARGS_PATH")" +[ "${ARGS}" = "${EXPECTED_ARGS}" ] || die "nvm_make_alias called with >${ARGS}<; expected >${EXPECTED_ARGS}<" + +cleanup diff --git a/test/fast/Unit tests/nvm_ls_remotenightly b/test/fast/Unit tests/nvm_ls_remotenightly new file mode 100644 index 0000000..47ba759 --- /dev/null +++ b/test/fast/Unit tests/nvm_ls_remotenightly @@ -0,0 +1,65 @@ +#!/bin/sh + +die () { echo "$@" ; cleanup ; exit 1; } + +cleanup() { + unset -f nvm_download +} + +\. ../../../nvm.sh + +MOCKS_DIR="$PWD/mocks" + +# sample output at the time the test was written +TAB_PATH="$MOCKS_DIR/nodejs.org-download-nightly-index.tab" +nvm_download() { + cat "$TAB_PATH" +} + +EXPECTED_OUTPUT_PATH="$MOCKS_DIR/nvm_ls_remote nightly.txt" + +OUTPUT="$(nvm_ls_remote foo)" +EXIT_CODE="$(nvm_ls_remote foo >/dev/null 2>&1 ; echo $?)" +[ "_$OUTPUT" = "_N/A" ] || die "nonexistent version did not report N/A" +[ "_$EXIT_CODE" = "_3" ] || die "nonexistent version did not exit with code 3, got $EXIT_CODE" + +OUTPUT="$(nvm_ls_remote)" +EXPECTED_OUTPUT="$(cat "$EXPECTED_OUTPUT_PATH")" +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "bare nvm_ls_remote did not output expected sorted versions; got $(echo ">$OUTPUT<") expected $(echo ">$EXPECTED_OUTPUT<")" + +OUTPUT="$(nvm_ls_remote 11)" +EXPECTED_OUTPUT="v11.0.0-nightly201810011be804d625 +v11.1.0-nightly20181101af6d26281f" +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm_ls_remote 11 did not output v11 nightly versions; got $OUTPUT" + +# Sanity checks +OUTPUT="$(nvm_print_implicit_alias remote stable)" +EXPECTED_OUTPUT_PATH="${MOCKS_DIR}/nvm_print_implicit_alias remote stable nightly.txt" +EXPECTED_OUTPUT="$(cat "${EXPECTED_OUTPUT_PATH}")" +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm_print_implicit_alias remote stable did not output $EXPECTED_OUTPUT; got $OUTPUT" + +OUTPUT="$(nvm_print_implicit_alias remote unstable)" +EXPECTED_OUTPUT="N/A" +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm_print_implicit_alias remote unstable did not output |$EXPECTED_OUTPUT|; got |$OUTPUT|" + +OUTPUT="$(nvm_ls_remote stable)" +EXPECTED_OUTPUT_PATH="${MOCKS_DIR}/nvm_ls_remote stable nightly.txt" +EXPECTED_OUTPUT="$(cat "${EXPECTED_OUTPUT_PATH}")" +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm_ls_remote stable did not output $EXPECTED_OUTPUT; got $OUTPUT" + +OUTPUT="$(nvm_ls_remote unstable)" +EXPECTED_OUTPUT="N/A" +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm_ls_remote unstable did not output |$EXPECTED_OUTPUT|; got |$OUTPUT|" + +EXPECTED_OUTPUT_PATH="$MOCKS_DIR/nvm_ls_remote LTS nightly.txt" +EXPECTED_OUTPUT="$(cat "$EXPECTED_OUTPUT_PATH")" +OUTPUT="$(NVM_LTS='*' nvm_ls_remote)" + +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "\`NVM_LTS='*' nvm_ls_remote\` did not output >$EXPECTED_OUTPUT<; got >$OUTPUT<" + +EXPECTED_OUTPUT_PATH="$MOCKS_DIR/nvm_ls_remote LTS nightly argon.txt" +EXPECTED_OUTPUT="$(cat "$EXPECTED_OUTPUT_PATH")" +OUTPUT="$(NVM_LTS=argon nvm_ls_remote)" +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "\`NVM_LTS=argon nvm_ls_remote\` did not output >$EXPECTED_OUTPUT<; got >$OUTPUT<" + +cleanup diff --git a/test/fast/Unit tests/nvm_print_implicit_alias errors b/test/fast/Unit tests/nvm_print_implicit_alias errors old mode 100755 new mode 100644 diff --git a/test/fast/Unit tests/nvm_print_implicit_alias success b/test/fast/Unit tests/nvm_print_implicit_alias success old mode 100755 new mode 100644 diff --git a/test/fast/Unit tests/nvm_print_implicit_aliaserrors b/test/fast/Unit tests/nvm_print_implicit_aliaserrors new file mode 100644 index 0000000..5565eea --- /dev/null +++ b/test/fast/Unit tests/nvm_print_implicit_aliaserrors @@ -0,0 +1,25 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +EXPECTED_FIRST_MSG="nvm_print_implicit_alias must be specified with local or remote as the first argument." +[ "_$(nvm_print_implicit_alias 2>&1)" = "_$EXPECTED_FIRST_MSG" ] \ + || die "nvm_print_implicit_alias did not require local|remote as first argument" +[ "_$(nvm_print_implicit_alias foo 2>&1)" = "_$EXPECTED_FIRST_MSG" ] \ + || die "nvm_print_implicit_alias did not require local|remote as first argument" + +FIRST_EXIT_CODE="$(nvm_print_implicit_alias > /dev/null 2>&1 ; echo $?)" +[ "_$FIRST_EXIT_CODE" = "_1" ] \ + || die "nvm_print_implicit_alias without local|remote had wrong exit code: expected 1, got $FIRST_EXIT_CODE" + +EXPECTED_SECOND_MSG="Only implicit aliases 'stable', 'unstable', 'iojs', and 'node' are supported." +[ "_$(nvm_print_implicit_alias local 2>&1)" = "_$EXPECTED_SECOND_MSG" ] \ + || die "nvm_print_implicit_alias did not require stable|unstable|iojs|node as second argument" +[ "_$(nvm_print_implicit_alias local foo 2>&1)" = "_$EXPECTED_SECOND_MSG" ] \ + || die "nvm_print_implicit_alias did not require stable|unstable|iojs|node as second argument" + +SECOND_EXIT_CODE="$(nvm_print_implicit_alias local > /dev/null 2>&1 ; echo $?)" +[ "_$SECOND_EXIT_CODE" = "_2" ] \ + || die "nvm_print_implicit_alias without stable|unstable|iojs|node had wrong exit code: expected 2, got $SECOND_EXIT_CODE" diff --git a/test/fast/Unit tests/nvm_print_implicit_aliassuccess b/test/fast/Unit tests/nvm_print_implicit_aliassuccess new file mode 100644 index 0000000..ded8174 --- /dev/null +++ b/test/fast/Unit tests/nvm_print_implicit_aliassuccess @@ -0,0 +1,106 @@ +#!/bin/sh + +die () { echo "$@" ; cleanup ; exit 1; } +cleanup() { + rm -rf "${NVM_DIR}/v0.2.3" + rm -rf "${NVM_DIR}/v0.3.4" + rm -rf "${NVM_DIR}/v0.4.6" + rm -rf "${NVM_DIR}/v0.5.7" + rm -rf "${NVM_DIR}/v0.7.7" + rm -rf "${NVM_DIR}/versions/io.js/v0.98.0" + rm -rf "${NVM_DIR}/versions/node/v1.0.0" + rm -rf "${NVM_DIR}/versions/node/v1.1.0" + unset -f nvm_ls_remote nvm_ls_remote_iojs +} + +\. ../../../nvm.sh +\. ../../common.sh + +make_fake_node v0.2.3 +make_fake_node v0.3.4 +make_fake_node v0.4.6 +make_fake_node v0.5.7 +make_fake_node v0.7.7 +make_fake_iojs v0.98.0 + +LATEST_STABLE="$(nvm_print_implicit_alias local stable)" +[ "_$LATEST_STABLE" = "_0.4" ] || die "local stable is not latest even minor: expected 0.4, got $LATEST_STABLE" + +LATEST_NODE="$(nvm_print_implicit_alias local node)" +[ "_$LATEST_NODE" = "_stable" ] || die "local node is not stable: expected stable, got $LATEST_NODE" + +LATEST_UNSTABLE="$(nvm_print_implicit_alias local unstable)" +[ "_$LATEST_UNSTABLE" = "_0.7" ] || die "local unstable is not latest odd minor: expected 0.7, got $LATEST_UNSTABLE" + +LATEST_IOJS="$(nvm_print_implicit_alias local iojs)" +[ "_$LATEST_IOJS" = "_iojs-v0.98" ] || die "local iojs is not latest iojs: expected iojs-v0.98, got $LATEST_IOJS" + +## node post v1.0/io.js merger ## +make_fake_node v1.0.0 +make_fake_node v1.1.0 + + +LATEST_STABLE="$(nvm_print_implicit_alias local stable)" +[ "_$LATEST_STABLE" = "_1.1" ] || die "local stable when post-v1.0 exists is not latest: expected 1.1, got $LATEST_STABLE" + +LATEST_UNSTABLE="$(nvm_print_implicit_alias local unstable)" +[ "_$LATEST_UNSTABLE" = "_0.7" ] || die "local unstable is not latest pre-v1.0 odd minor: expected 0.7, got $LATEST_UNSTABLE" +## ** ## + +nvm_ls_remote() { + echo "v0.4.3" + echo "v0.5.4" + echo "v0.6.6" + echo "v0.7.7" + echo "v0.9.7" + echo "v0.4.3" + echo "v0.5.4" + echo "v0.6.6" + echo "v0.7.7" + echo "v0.9.7" +} + +nvm_ls_remote_iojs() { + echo "iojs-v0.1.0" + echo "iojs-v0.1.1" + echo "iojs-v0.7.8" + echo "iojs-v0.98.5" + echo "iojs-v0.99.0" +} + +LATEST_STABLE="$(nvm_print_implicit_alias remote stable)" +[ "_$LATEST_STABLE" = "_0.6" ] || die "remote stable is not latest even minor: expected 0.6, got $LATEST_STABLE" + +LATEST_NODE="$(nvm_print_implicit_alias remote node)" +[ "_$LATEST_NODE" = "_stable" ] || die "remote node is not stable: expected stable, got $LATEST_NODE" + +LATEST_UNSTABLE="$(nvm_print_implicit_alias remote unstable)" +[ "_$LATEST_UNSTABLE" = "_0.9" ] || die "remote unstable is not latest odd minor: expected 0.9, got $LATEST_UNSTABLE" + +LATEST_IOJS="$(nvm_print_implicit_alias remote iojs)" +[ "_$LATEST_IOJS" = "_iojs-v0.99" ] || die "remote iojs is not latest: expected iojs-v0.99, got $LATEST_IOJS" + +## node post v1.0/io.js merger ## +nvm_ls_remote() { + echo "v0.4.3" + echo "v0.5.4" + echo "v0.6.6" + echo "v0.7.7" + echo "v0.9.7" + echo "v0.4.3" + echo "v0.5.4" + echo "v0.6.6" + echo "v0.7.7" + echo "v0.9.7" + echo "v1.0.0" + echo "v1.1.0" +} + +LATEST_STABLE="$(nvm_print_implicit_alias remote stable)" +[ "_$LATEST_STABLE" = "_1.1" ] || die "remote stable when post-v1.0 exists is not latest: expected 1.1, got $LATEST_STABLE" + +LATEST_UNSTABLE="$(nvm_print_implicit_alias remote unstable)" +[ "_$LATEST_UNSTABLE" = "_0.9" ] || die "remote unstable is not latest odd pre-v1.0 minor: expected 0.9, got $LATEST_UNSTABLE" +## ** ## + +cleanup diff --git a/test/fast/Unit tests/nvmls-remote b/test/fast/Unit tests/nvmls-remote new file mode 100644 index 0000000..683fe92 --- /dev/null +++ b/test/fast/Unit tests/nvmls-remote @@ -0,0 +1,73 @@ +#!/bin/sh + +set -e + +die () { echo "$@" ; cleanup ; exit 1; } + +cleanup() { + unset -f nvm_download nvm_ls_remote nvm_ls_remote_iojs + if [ -n TEMP_NVM_COLORS ]; then + export NVM_COLORS=TEMP_NVM_COLORS + fi + unset TEMP_NVM_COLORS +} + +\. ../../../nvm.sh +if [ -n ${NVM_COLORS} ]; then + export TEMP_NVM_COLORS=NVM_COLORS + unset NVM_COLORS +fi + +nvm deactivate 2>/dev/null || die 'unable to deactivate' + +\. ../../common.sh + +MOCKS_DIR="$PWD/mocks" + +nvm_download() { + if [ "$*" = "-L -s $(nvm_get_mirror node std)/index.tab -o -" ]; then + cat "$MOCKS_DIR/nodejs.org-dist-index.tab" + return + fi + return 42 +} + +EXPECTED_OUTPUT_PATH="${MOCKS_DIR}/nvm ls-remote lts.txt" +OUTPUT="$(nvm ls-remote --lts | sed 's/[ \t]*$//')" +EXPECTED_OUTPUT="$(cat "$EXPECTED_OUTPUT_PATH" | sed 's/[ \t]*$//' )" +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm ls-remote --lts did not output expected sorted versions; got $(echo ">$OUTPUT<") expected $(echo ">$EXPECTED_OUTPUT<")" + +EXPECTED_OUTPUT_PATH="${MOCKS_DIR}/nvm ls-remote lts.txt" +OUTPUT="$(nvm ls-remote "lts/*" | sed 's/[ \t]*$//')" +EXPECTED_OUTPUT="$(cat "$EXPECTED_OUTPUT_PATH" | sed 's/[ \t]*$//' )" +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm ls-remote lts/* did not output expected sorted versions; got $(echo ">$OUTPUT<") expected $(echo ">$EXPECTED_OUTPUT<")" + +MOCKS_DIR="$PWD/mocks" +LTS_NAMES_PATH="${MOCKS_DIR}/LTS_names.txt" +LTS_LIST="$(cat "${LTS_NAMES_PATH}" | tail -n +2)" + +INDEX=1 +printf '%s\n' "${LTS_LIST}" | while IFS= read -r LTS; do + ACTUAL="$(nvm ls-remote "lts/-${INDEX}" | sed 's/[ \t]*$//')" + MESSAGE="for lts/-${INDEX} (${LTS})" + EXPECTED="$(nvm ls-remote "lts/${LTS}" | sed 's/[ \t]*$//')" + [ "${ACTUAL}" = "${EXPECTED}" ] || die "${MESSAGE}: expected >${EXPECTED}<, got >${ACTUAL}<" + + INDEX=$(($INDEX + 1)) +done + +REMOTE="$PWD/mocks/nvm_ls_remote.txt" +nvm_ls_remote() { + cat "$REMOTE" +} +REMOTE_IOJS="$PWD/mocks/nvm_ls_remote_iojs.txt" +nvm_ls_remote_iojs() { + cat "$REMOTE_IOJS" +} + +EXPECTED_OUTPUT_PATH="${MOCKS_DIR}/nvm ls-remote.txt" +OUTPUT="$(nvm ls-remote | sed 's/[ \t]*$//')" +EXPECTED_OUTPUT="$(cat "$EXPECTED_OUTPUT_PATH" | sed 's/[ \t]*$//' )" +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "bare nvm ls-remote did not output expected sorted versions; got $(echo ">$OUTPUT<") expected $(echo ">$EXPECTED_OUTPUT<")" + +cleanup diff --git a/test/fast/Unit tests/nvmset_colors b/test/fast/Unit tests/nvmset_colors new file mode 100644 index 0000000..85496eb --- /dev/null +++ b/test/fast/Unit tests/nvmset_colors @@ -0,0 +1,52 @@ +#!/bin/sh + +set -ex + +die () { echo "$@" ; cleanup ; exit 1; } + +cleanup() { + unset NVM_COLORS + unset -f nvm_has_colors + if [ -n TEMP_NVM_COLORS ]; then + export NVM_COLORS=TEMP_NVM_COLORS + fi + unset TEMP_NVM_COLORS +} + +\. ../../../nvm.sh +# NVM_COLORS is not set +if [ -n ${NVM_COLORS} ]; then + export TEMP_NVM_COLORS=NVM_COLORS + unset NVM_COLORS +fi + +# test valid setting colors/ +nvm set-colors rgbyc +OUTPUT="${NVM_COLORS}" +EXPECTED_OUTPUT="rgbyc" +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "NVM_SET_COLORS failed with valid input; got >${OUTPUT}< expected >${EXPECTED_OUTPUT}<" + +# test invalid 4 colors +set +ex +OUTPUT="$(echo $(nvm set-colors rgby 2>&1) | awk '{ print substr($0, length($0)-92, 93); }')" +EXPECTED_OUTPUT="$(command printf %b "\033[1;37mPlease pass in five \033[1;31mvalid color codes\033[1;37m. Choose from: rRgGbBcCyYmMkKeW\033[0m")" +set -ex + +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "NVM_SET_COLORS did not fail with invalid input; got >${OUTPUT}, < expected >${EXPECTED_OUTPUT}<" + +# test invalid color codes +set +ex +OUTPUT="$(echo $(nvm set-colors p3gq7 2>&1) | awk '{ print substr($0, length($0)-92, 93); }')" +EXPECTED_OUTPUT="$(command printf %b "\033[1;37mPlease pass in five \033[1;31mvalid color codes\033[1;37m. Choose from: rRgGbBcCyYmMkKeW\033[0m")" +set -ex +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "NVM_SET_COLORS did not fail with invalid input; got >${OUTPUT}<, expected >${EXPECTED_OUTPUT}<" + +#test system does not support at least 8 colors +nvm_has_colors() { return 1; } +set +ex +OUTPUT="$(echo $(nvm set-colors mcyGb 2>&1) | awk '{ print substr($0, length($0)-76, 77); }')" +set -ex +EXPECTED_OUTPUT="WARNING: Colors may not display because they are not supported in this shell." +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "NVM_SET_COLORS did not recognize lack of color support; got >${OUTPUT}<, expected >${EXPECTED_OUTPUT}<" + +cleanup diff --git a/test/fast/Unit tests/nvmversion-remote b/test/fast/Unit tests/nvmversion-remote new file mode 100644 index 0000000..6a3beeb --- /dev/null +++ b/test/fast/Unit tests/nvmversion-remote @@ -0,0 +1,51 @@ +#!/bin/sh + +set -ex + +die () { echo "$@" ; cleanup ; exit 1; } + +cleanup() { + unset -f nvm_remote_version +} + +\. ../../../nvm.sh + +\. ../../common.sh + +nvm_remote_version() { + echo "NVM_VERSION_ONLY:${NVM_VERSION_ONLY-},NVM_LTS:${NVM_LTS-},PATTERN:${PATTERN-}" +} + +OUTPUT="$(nvm version-remote foo)" +EXPECTED_OUTPUT='NVM_VERSION_ONLY:true,NVM_LTS:,PATTERN:foo' +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "\`nvm version-remote foo\` called nvm_remote_version with >${OUTPUT}<, expected >${EXPECTED_OUTPUT}<" + +OUTPUT="$(nvm version-remote --lts foo)" +EXPECTED_OUTPUT='NVM_VERSION_ONLY:true,NVM_LTS:*,PATTERN:foo' +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "\`nvm version-remote --lts foo\` called nvm_remote_version with >${OUTPUT}<, expected >${EXPECTED_OUTPUT}<" + +OUTPUT="$(nvm version-remote foo --lts)" +EXPECTED_OUTPUT='NVM_VERSION_ONLY:true,NVM_LTS:*,PATTERN:foo' +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "\`nvm version-remote foo --lts\` called nvm_remote_version with >${OUTPUT}<, expected >${EXPECTED_OUTPUT}<" + +OUTPUT="$(nvm version-remote --lts=argon foo)" +EXPECTED_OUTPUT='NVM_VERSION_ONLY:true,NVM_LTS:argon,PATTERN:foo' +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "\`nvm version-remote --lts=argon foo\` called nvm_remote_version with >${OUTPUT}<, expected >${EXPECTED_OUTPUT}<" + +OUTPUT="$(nvm version-remote lts/foo)" +EXPECTED_OUTPUT='NVM_VERSION_ONLY:true,NVM_LTS:foo,PATTERN:' +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "\`nvm version-remote lts/foo\` called nvm_remote_version with >${OUTPUT}<, expected >${EXPECTED_OUTPUT}<" + +OUTPUT="$(nvm version-remote 'lts/*')" +EXPECTED_OUTPUT='NVM_VERSION_ONLY:true,NVM_LTS:*,PATTERN:' +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "\`nvm version-remote lts/*\` called nvm_remote_version with >${OUTPUT}<, expected >${EXPECTED_OUTPUT}<" + +set +ex # needed for stderr +OUTPUT="$(nvm version-remote --foo bar 2>&1)" +set -ex +EXPECTED_OUTPUT='Unsupported option "--foo".' +EXIT_CODE="$(nvm version-remote --foo bar >/dev/null 2>&1 && echo $? || echo $?)" +[ "${EXIT_CODE}" = 55 ] || die "\`nvm version-remote --foo bar\` did not exit with code 55, got >${EXIT_CODE}<" +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "\`nvm version-remote --foo bar\` errored with >${OUTPUT}<, expected >${EXPECTED_OUTPUT}<" + +cleanup diff --git a/test/slow/nvm exec/Preamble works and respects 'silent' flag b/test/slow/nvm exec/Preamble works and respects 'silent' flag old mode 100755 new mode 100644 diff --git a/test/slow/nvm exec/Preambleworks and respects 'silent' flag b/test/slow/nvm exec/Preambleworks and respects 'silent' flag new file mode 100644 index 0000000..08d0410 --- /dev/null +++ b/test/slow/nvm exec/Preambleworks and respects 'silent' flag @@ -0,0 +1,30 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +nvm use 0.10 +NPM_VERSION_TEN="$(npm --version)" +NODE_VERSION_TEN="$(node --version)" + +nvm use 1.0.0 && [ "$(node --version)" = "v1.0.0" ] || die "\`nvm use\` failed!" +NPM_VERSION_ONE="$(npm --version)" + +OUTPUT="$(nvm exec 0.10 npm --version)" +EXPECTED_OUTPUT="Running node ${NODE_VERSION_TEN} (npm v${NPM_VERSION_TEN}) +${NPM_VERSION_TEN}" +[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "\`nvm exec\` failed to report node preamble; expected '$EXPECTED_OUTPUT', got '$OUTPUT'" + +OUTPUT="$(nvm exec --silent 0.10 npm --version | head -1)" +EXPECTED_OUTPUT="${NPM_VERSION_TEN}" +[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "\`nvm exec --silent\` failed to node suppress preamble; expected '$EXPECTED_OUTPUT', got '$OUTPUT'" + +OUTPUT="$(nvm exec 1 npm --version)" +EXPECTED_OUTPUT="Running io.js v1.0.0 (npm v${NPM_VERSION_ONE}) +${NPM_VERSION_ONE}" +[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "\`nvm exec\` failed to report io.js preamble; expected '$EXPECTED_OUTPUT', got '$OUTPUT'" + +OUTPUT="$(nvm exec --silent 1 npm --version | head -1)" +EXPECTED_OUTPUT="${NPM_VERSION_ONE}" +[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "\`nvm exec --silent\` failed to suppress io.js preamble; expected '$EXPECTED_OUTPUT', got '$OUTPUT'" diff --git a/test/slow/nvm exec/Running 'nvm exec --lts' should work b/test/slow/nvm exec/Running 'nvm exec --lts' should work old mode 100755 new mode 100644 diff --git a/test/slow/nvm exec/Running 'nvm exec 0.x' should work b/test/slow/nvm exec/Running 'nvm exec 0.x' should work old mode 100755 new mode 100644 diff --git a/test/slow/nvm exec/Running 'nvm exec' should pick up .nvmrc version b/test/slow/nvm exec/Running 'nvm exec' should pick up .nvmrc version old mode 100755 new mode 100644 diff --git a/test/slow/nvm exec/Running'nvm exec --lts' should work b/test/slow/nvm exec/Running'nvm exec --lts' should work new file mode 100644 index 0000000..1be7c61 --- /dev/null +++ b/test/slow/nvm exec/Running'nvm exec --lts' should work @@ -0,0 +1,18 @@ +#!/bin/sh + +set -ex + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +nvm install --lts || die 'nvm install --lts failed' + +NPM_VERSION_LTS="$(npm --version)" +TEST_STRING="foo bar" + +nvm use 1.0.0 && [ "$(node --version)" = "v1.0.0" ] || die "\`nvm use\` failed!" + +[ "$(nvm exec --lts npm --version | tail -1)" = "$NPM_VERSION_LTS" ] || die "`nvm exec` failed to run with the correct version" + +[ "$(nvm exec --lts bash -c "printf '$TEST_STRING'" | tail -1)" = "$TEST_STRING" ] || die "\`nvm exec\` failed to run with a command including whitespace" diff --git a/test/slow/nvm exec/Running'nvm exec 0.x' should work b/test/slow/nvm exec/Running'nvm exec 0.x' should work new file mode 100644 index 0000000..88ff70a --- /dev/null +++ b/test/slow/nvm exec/Running'nvm exec 0.x' should work @@ -0,0 +1,15 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +nvm use 0.10 +NPM_VERSION_TEN="$(npm --version)" +TEST_STRING="foo bar" + +nvm use 1.0.0 && [ "$(node --version)" = "v1.0.0" ] || die "\`nvm use\` failed!" + +[ "$(nvm exec 0.10 npm --version | tail -1)" = "$NPM_VERSION_TEN" ] || die "\`nvm exec\` failed to run with the correct version" + +[ "$(nvm exec 0.10 bash -c "printf '$TEST_STRING'" | tail -1)" = "$TEST_STRING" ] || die "\`nvm exec\` failed to run with a command including whitespace" diff --git a/test/slow/nvm exec/Running'nvm exec' should pick up .nvmrc version b/test/slow/nvm exec/Running'nvm exec' should pick up .nvmrc version new file mode 100644 index 0000000..8d3dcae --- /dev/null +++ b/test/slow/nvm exec/Running'nvm exec' should pick up .nvmrc version @@ -0,0 +1,16 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +nvm use 0.10.7 +NPM_VERSION_TEN="$(npm --version)" + +nvm use 1.0.0 && [ "$(node --version)" = "v1.0.0" ] || die "\`nvm use\` failed!" + +echo "0.10.7" > .nvmrc + +[ "$(nvm exec npm --version | tail -1)" = "$NPM_VERSION_TEN" ] || die "\`nvm exec\` failed to run with the .nvmrc version" + +[ "$(nvm exec npm --version | head -1)" = "Found '$PWD/.nvmrc' with version <0.10.7>" ] || die "\`nvm exec\` failed to print out the \"found in .nvmrc\" message" diff --git a/test/slow/nvm exec/Running'nvm exec' with help should not parse b/test/slow/nvm exec/Running'nvm exec' with help should not parse new file mode 100644 index 0000000..4e8b632 --- /dev/null +++ b/test/slow/nvm exec/Running'nvm exec' with help should not parse @@ -0,0 +1,9 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +nvm use 0.10 + +nvm exec stable -- node --help | grep 'Usage: node [options]' || die "Help menu should have been displayed for node and not nvm" diff --git a/test/slow/nvm reinstall-packages/Running 'nvm copy-packages $(nvm ls current)' should error out b/test/slow/nvm reinstall-packages/Running 'nvm copy-packages $(nvm ls current)' should error out old mode 100755 new mode 100644 diff --git a/test/slow/nvm reinstall-packages/Running'nvm copy-packages $(nvm ls current)' should error out b/test/slow/nvm reinstall-packages/Running'nvm copy-packages $(nvm ls current)' should error out new file mode 100644 index 0000000..d5f8571 --- /dev/null +++ b/test/slow/nvm reinstall-packages/Running'nvm copy-packages $(nvm ls current)' should error out @@ -0,0 +1,17 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +nvm use 0.10.28 > /dev/null + +nvm install-latest-npm || die 'nvm install-latest-npm failed' + +EXPECTED_MSG="Can not reinstall packages from the current version of node." +ACTUAL_MSG="$(nvm reinstall-packages 0.10.28 2>&1 > /dev/null)" +[ "~$ACTUAL_MSG" = "~$EXPECTED_MSG" ] || die "'nvm use 0.10.28 && nvm reinstall-packages 0.10.28' did not fail with the right message: '$ACTUAL_MESSAGE'" + +EXPECTED_ERROR_CODE="2" +ACTUAL_ERROR_CODE="$(nvm reinstall-packages 0.10.28 > /dev/null 2>&1 ; echo $?)" +[ "~$ACTUAL_ERROR_CODE" = "~$EXPECTED_ERROR_CODE" ] || die "'nvm use 0.10.28 && nvm reinstall-packages 0.10.28' did not fail with the right error code: expected '$EXPECTED_ERROR_CODE', got '$ACTUAL_ERROR_CODE'" diff --git a/test/slow/nvm reinstall-packages/should work as expected b/test/slow/nvm reinstall-packages/should work as expected old mode 100755 new mode 100644 diff --git a/test/slow/nvm reinstall-packages/shouldwork as expected b/test/slow/nvm reinstall-packages/shouldwork as expected new file mode 100644 index 0000000..755c6f6 --- /dev/null +++ b/test/slow/nvm reinstall-packages/shouldwork as expected @@ -0,0 +1,31 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +nvm exec 0.10.28 npm install -g npm@~1.4.11 && nvm install-latest-npm # this is required because before 1.4.10, npm ls doesn't indicated linked packages +nvm exec 0.10.29 npm install -g npm@~1.4.11 && nvm install-latest-npm # this is required because before 1.4.10, npm ls doesn't indicated linked packages + +nvm use 0.10.28 +(cd test-npmlink && npm link) + +EXPECTED_PACKAGES="autoprefixer bower david grunt-cli grunth-cli http-server jshint marked node-gyp npmlist postcss recursive-blame spawn-sync test-npmlink uglify-js yo" +EXPECTED_PACKAGES_INSTALL="autoprefixer bower david@11 grunt-cli grunth-cli http-server jshint marked node-gyp@7 npmlist postcss@4 recursive-blame spawn-sync test-npmlink uglify-js yo@1" + +echo "$EXPECTED_PACKAGES_INSTALL" | sed -e 's/test-npmlink //' | xargs npm install -g --quiet + +get_packages() { + npm list -g --depth=0 | \sed -e '1 d' -e 's/^.* \(.*\)@.*/\1/' -e '/^npm$/ d' | xargs +} + +nvm use 0.10.29 +ORIGINAL_PACKAGES=$(get_packages) + +nvm reinstall-packages 0.10.28 +FINAL_PACKAGES=$(get_packages) + +[ "$FINAL_PACKAGES" = "$EXPECTED_PACKAGES" ] || die "final packages ($FINAL_PACKAGES) did not match expected packages ($EXPECTED_PACKAGES)" +[ "$ORIGINAL_PACKAGES" != "$FINAL_PACKAGES" ] || die "original packages matched final packages ($ORIGINAL_PACKAGES)" + +[ $(test-npmlink) = 'ok' ] || die "failed to run test-npmlink" diff --git a/test/slow/nvm reinstall-packages/works with no installs b/test/slow/nvm reinstall-packages/works with no installs old mode 100755 new mode 100644 diff --git a/test/slow/nvm reinstall-packages/workswith no installs b/test/slow/nvm reinstall-packages/workswith no installs new file mode 100644 index 0000000..ade209a --- /dev/null +++ b/test/slow/nvm reinstall-packages/workswith no installs @@ -0,0 +1,18 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +get_packages() { + npm list -g --depth=0 | \sed -e '1 d' -e 's/^.* \(.*\)@.*/\1/' -e '/^npm$/ d' | xargs +} + +nvm use 4.7.2 +ORIGINAL_PACKAGES=$(get_packages) + +nvm reinstall-packages 4.7.1 +FINAL_PACKAGES=$(get_packages) + +[ -z "${ORIGINAL_PACKAGES}" ] || die "original packages were not empty: ${ORIGINAL_PACKAGES}" +[ -z "${FINAL_PACKAGES}" ] || die "final packages were not empty: ${FINAL_PACKAGES}" diff --git a/test/slow/nvm run/Running 'nvm run --harmony --version' should work b/test/slow/nvm run/Running 'nvm run --harmony --version' should work old mode 100755 new mode 100644 diff --git a/test/slow/nvm run/Running 'nvm run --lts' should work b/test/slow/nvm run/Running 'nvm run --lts' should work old mode 100755 new mode 100644 diff --git a/test/slow/nvm run/Running 'nvm run 0.x' should error out sensibly when 0.x is not installed b/test/slow/nvm run/Running 'nvm run 0.x' should error out sensibly when 0.x is not installed old mode 100755 new mode 100644 diff --git a/test/slow/nvm run/Running 'nvm run 0.x' should work b/test/slow/nvm run/Running 'nvm run 0.x' should work old mode 100755 new mode 100644 diff --git a/test/slow/nvm run/Running 'nvm run' should pick up .nvmrc version b/test/slow/nvm run/Running 'nvm run' should pick up .nvmrc version old mode 100755 new mode 100644 diff --git a/test/slow/nvm run/Running'nvm run --harmony --version' should work b/test/slow/nvm run/Running'nvm run --harmony --version' should work new file mode 100644 index 0000000..28912d1 --- /dev/null +++ b/test/slow/nvm run/Running'nvm run --harmony --version' should work @@ -0,0 +1,8 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +nvm run 0.10.7 --harmony --version +[ "_$(nvm run 0.10.7 --harmony --version 2>/dev/null | tail -1)" = "_v0.10.7" ] || die "\`nvm run --harmony --version\` failed to run with the correct version" diff --git a/test/slow/nvm run/Running'nvm run --lts' should work b/test/slow/nvm run/Running'nvm run --lts' should work new file mode 100644 index 0000000..ead0dbd --- /dev/null +++ b/test/slow/nvm run/Running'nvm run --lts' should work @@ -0,0 +1,15 @@ +#!/bin/sh + +set -ex + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +OUTPUT="$(nvm run --silent --lts --version)" +EXPECTED_OUTPUT="$(nvm_match_version 'lts/*')" +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "\`nvm run --lts\` failed to run with the correct version; expected >${EXPECTED_OUTPUT}<, got >${OUTPUT}<" + +OUTPUT="$(nvm run --silent --lts=argon --version)" +EXPECTED_OUTPUT="$(nvm_match_version 'lts/argon')" +[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "\`nvm run --lts=argon\` failed to run with the correct version; expected >${EXPECTED_OUTPUT}<, got >${OUTPUT}<" diff --git a/test/slow/nvm run/Running'nvm run 0.x' should error out sensibly when 0.x is not installed b/test/slow/nvm run/Running'nvm run 0.x' should error out sensibly when 0.x is not installed new file mode 100644 index 0000000..c38b428 --- /dev/null +++ b/test/slow/nvm run/Running'nvm run 0.x' should error out sensibly when 0.x is not installed @@ -0,0 +1,16 @@ +#!/bin/sh + + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +EXPECTED_OUTPUT='N/A: version "v0.2" is not yet installed. + +You need to run `nvm install 0.2` to install and use it.' +[ "_$(nvm run 0.2 --version 2>&1)" = "_$EXPECTED_OUTPUT" ] || die "\`nvm run\` with an uninstalled node version failed to error out correctly" + +EXPECTED_OUTPUT='N/A: version "iojs-v0.2" is not yet installed. + +You need to run `nvm install iojs-0.2` to install and use it.' +[ "_$(nvm run iojs-0.2 --version 2>&1)" = "_$EXPECTED_OUTPUT" ] || die "\`nvm run\` with an uninstalled iojs version failed to error out correctly" diff --git a/test/slow/nvm run/Running'nvm run 0.x' should work b/test/slow/nvm run/Running'nvm run 0.x' should work new file mode 100644 index 0000000..d537d4a --- /dev/null +++ b/test/slow/nvm run/Running'nvm run 0.x' should work @@ -0,0 +1,8 @@ +#!/bin/sh + + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +[ "$(nvm run 0.10.7 --version | tail -1)" = "v0.10.7" ] || die "\`nvm run\` failed to run with the correct version" diff --git a/test/slow/nvm run/Running'nvm run' should pick up .nvmrc version b/test/slow/nvm run/Running'nvm run' should pick up .nvmrc version new file mode 100644 index 0000000..a349689 --- /dev/null +++ b/test/slow/nvm run/Running'nvm run' should pick up .nvmrc version @@ -0,0 +1,25 @@ +#!/bin/sh + + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +echo "0.10.7" > .nvmrc + +[ "$(nvm run --version | tail -1)" = "v0.10.7" ] || die "\`nvm run\` failed to run with the .nvmrc version" + +[ "$(nvm run --version | head -1)" = "Found '$PWD/.nvmrc' with version <0.10.7>" ] || die "\`nvm run\` failed to print out the \"found in .nvmrc\" message" + + +echo "foo" > .nvmrc + +# running nvm run with .nvmrc should not print the version information when not installed +OUTPUT="$(nvm run --version 2>&1)" +EXIT_CODE=$? +EXPECTED_OUTPUT="Found '$PWD/.nvmrc' with version +N/A: version \"foo\" is not yet installed. + +You need to run \`nvm install\` to install and use the node version specified in \`.nvmrc\`." +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "expected 'nvm use' with nvmrc to give $EXPECTED_OUTPUT, got $OUTPUT" +[ "_$EXIT_CODE" = "_1" ] || die "expected 'nvm use' with nvmrc to exit with 1, got $EXIT_CODE" diff --git a/test/slow/nvm uninstall/Running 'nvm uninstall 0.12.6' uninstalls v0.12.6 b/test/slow/nvm uninstall/Running 'nvm uninstall 0.12.6' uninstalls v0.12.6 old mode 100755 new mode 100644 diff --git a/test/slow/nvm uninstall/Running 'nvm uninstall' with incorrect file permissions fails nicely b/test/slow/nvm uninstall/Running 'nvm uninstall' with incorrect file permissions fails nicely old mode 100755 new mode 100644 diff --git a/test/slow/nvm uninstall/Running'nvm uninstall 0.12.6' uninstalls v0.12.6 b/test/slow/nvm uninstall/Running'nvm uninstall 0.12.6' uninstalls v0.12.6 new file mode 100644 index 0000000..ec6a658 --- /dev/null +++ b/test/slow/nvm uninstall/Running'nvm uninstall 0.12.6' uninstalls v0.12.6 @@ -0,0 +1,33 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +# Source nvm +\. ../../../nvm.sh + +# Version to install/uninstall +NVM_TEST_VERSION=0.12.6 + +# Make sure it's not already here +[ -e ../../../$NVM_TEST_VERSION ] && rm -R ../../../$NVM_TEST_VERSION + +# Install it +nvm install $NVM_TEST_VERSION + +# Make sure it installed +nvm ls | grep "$NVM_TEST_VERSION" || die "Failed to install node" + +# Switch to another version so we can uninstall +nvm use 0.12.7 + +# if zsh, set "nomatch" opt to reproduce failure from https://github.com/nvm-sh/nvm/issues/1228 +if nvm_has "setopt"; then + setopt nomatch +fi + +# Uninstall it +nvm uninstall $NVM_TEST_VERSION + +# Make sure it uninstalled +nvm ls | grep "$NVM_TEST_VERSION" +[ "$?" != "0" ] || die "Failed to uninstall node" diff --git a/test/slow/nvm uninstall/Running'nvm uninstall' with incorrect file permissions fails nicely b/test/slow/nvm uninstall/Running'nvm uninstall' with incorrect file permissions fails nicely new file mode 100644 index 0000000..0c19db8 --- /dev/null +++ b/test/slow/nvm uninstall/Running'nvm uninstall' with incorrect file permissions fails nicely @@ -0,0 +1,30 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +# Source nvm +\. ../../../nvm.sh + +# Version to install/uninstall +NVM_TEST_VERSION=5.10.1 + +# Make sure it's not already here +[ -e ../../../$NVM_TEST_VERSION ] && rm -R ../../../$NVM_TEST_VERSION + +# Install it +nvm install $NVM_TEST_VERSION + +# Make sure it installed +nvm ls | grep "$NVM_TEST_VERSION" || die "Failed to install node" + +# Install global module as root +npm_path=$(which npm) +sudo -n "$npm_path" install jspm@'<2' -g || die 'either sudo failed, or `npm install jspm -g` failed`' + +# Switch to another version so we can uninstall +nvm use 0.12.7 + +# Attempt to uninstall it +RETURN_MESSAGE="$(nvm uninstall $NVM_TEST_VERSION 2>&1)" +CHECK_FOR="Cannot uninstall, incorrect permissions on installation folder" +test "${RETURN_MESSAGE#*$CHECK_FOR}" != "$RETURN_MESSAGE" || die "Failed to show error message" diff --git a/test/slow/nvm use/Running 'nvm use --lts' uses latest LTS version b/test/slow/nvm use/Running 'nvm use --lts' uses latest LTS version old mode 100755 new mode 100644 diff --git a/test/slow/nvm use/Running 'nvm use --lts=foo' uses latest 'foo' LTS version b/test/slow/nvm use/Running 'nvm use --lts=foo' uses latest 'foo' LTS version old mode 100755 new mode 100644 diff --git a/test/slow/nvm use/Running 'nvm use iojs' uses latest io.js version b/test/slow/nvm use/Running 'nvm use iojs' uses latest io.js version old mode 100755 new mode 100644 diff --git a/test/slow/nvm use/Running 'nvm use node --silent' doesn't print anything b/test/slow/nvm use/Running 'nvm use node --silent' doesn't print anything old mode 100755 new mode 100644 diff --git a/test/slow/nvm use/Running 'nvm use node' uses latest stable node version b/test/slow/nvm use/Running 'nvm use node' uses latest stable node version old mode 100755 new mode 100644 diff --git a/test/slow/nvm use/Running 'nvm use v1.0.0' uses iojs-v1.0.0 iojs version b/test/slow/nvm use/Running 'nvm use v1.0.0' uses iojs-v1.0.0 iojs version old mode 100755 new mode 100644 diff --git a/test/slow/nvm use/Running 'nvm use' calls 'nvm_die_on_prefix' b/test/slow/nvm use/Running 'nvm use' calls 'nvm_die_on_prefix' old mode 100755 new mode 100644 diff --git a/test/slow/nvm use/Running'nvm use --lts' uses latest LTS version b/test/slow/nvm use/Running'nvm use --lts' uses latest LTS version new file mode 100644 index 0000000..f5b9ec0 --- /dev/null +++ b/test/slow/nvm use/Running'nvm use --lts' uses latest LTS version @@ -0,0 +1,22 @@ +#!/bin/sh + +set -ex + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +nvm deactivate >/dev/null 2>&1 || die 'deactivate failed' + +nvm use --lts || die 'nvm use --lts failed' +OUTPUT="$(nvm current)" +EXPECTED_OUTPUT="$(nvm_resolve_alias 'lts/*')" + +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \ + || die "'nvm use --lts' + 'nvm current' did not output '$EXPECTED_OUTPUT'; got '$OUTPUT'" + +OUTPUT="$(nvm use --silent --lts)" +EXPECTED_OUTPUT="" + +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \ + || die "'nvm use --silent --lts' output was not silenced '$EXPECTED_OUTPUT'; got '$OUTPUT'" diff --git a/test/slow/nvm use/Running'nvm use --lts=foo' uses latest 'foo' LTS version b/test/slow/nvm use/Running'nvm use --lts=foo' uses latest 'foo' LTS version new file mode 100644 index 0000000..0801673 --- /dev/null +++ b/test/slow/nvm use/Running'nvm use --lts=foo' uses latest 'foo' LTS version @@ -0,0 +1,22 @@ +#!/bin/sh + +set -ex + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +nvm deactivate 2>&1 >/dev/null || die 'deactivate failed' + +nvm use --lts=testing || die 'nvm use --lts=testing failed' +OUTPUT="$(nvm current)" +EXPECTED_OUTPUT="$(nvm_resolve_alias 'lts/testing')" + +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \ + || die "'nvm use --lts=testing' + 'nvm current' did not output '$EXPECTED_OUTPUT'; got '$OUTPUT'" + +OUTPUT="$(nvm use --silent --lts=testing)" +EXPECTED_OUTPUT="" + +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \ + || die "'nvm use --silent --lts=testing' output was not silenced '$EXPECTED_OUTPUT'; got '$OUTPUT'" diff --git a/test/slow/nvm use/Running'nvm use iojs' uses latest io.js version b/test/slow/nvm use/Running'nvm use iojs' uses latest io.js version new file mode 100644 index 0000000..9b83d08 --- /dev/null +++ b/test/slow/nvm use/Running'nvm use iojs' uses latest io.js version @@ -0,0 +1,20 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +nvm deactivate 2>&1 >/dev/null || die 'deactivate failed' + +nvm use iojs || die 'nvm use iojs failed' +OUTPUT="$(nvm current)" +EXPECTED_OUTPUT="iojs-v1.0.1" + +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \ + || die "'nvm use iojs' + 'nvm current' did not output '$EXPECTED_OUTPUT'; got '$OUTPUT'" + +OUTPUT="$(nvm use --silent iojs)" +EXPECTED_OUTPUT="" + +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \ + || die "'nvm use --silent iojs' output was not silenced '$EXPECTED_OUTPUT'; got '$OUTPUT'" diff --git a/test/slow/nvm use/Running'nvm use node --silent' doesn't print anything b/test/slow/nvm use/Running'nvm use node --silent' doesn't print anything new file mode 100644 index 0000000..1da47e8 --- /dev/null +++ b/test/slow/nvm use/Running'nvm use node --silent' doesn't print anything @@ -0,0 +1,13 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +nvm deactivate 2>&1 >/dev/null || die 'deactivate failed' + +OUTPUT=$(nvm use node --silent || die 'nvm use node failed') +EXPECTED_OUTPUT="" + +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \ + || die "'nvm use node --silent' output was not silenced to '$EXPECTED_OUTPUT'; got '$OUTPUT'" diff --git a/test/slow/nvm use/Running'nvm use node' uses latest stable node version b/test/slow/nvm use/Running'nvm use node' uses latest stable node version new file mode 100644 index 0000000..c87f3b4 --- /dev/null +++ b/test/slow/nvm use/Running'nvm use node' uses latest stable node version @@ -0,0 +1,20 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +nvm deactivate 2>&1 >/dev/null || die 'deactivate failed' + +nvm use node || die 'nvm use node failed' +OUTPUT="$(nvm current)" +EXPECTED_OUTPUT="$(nvm_version stable)" + +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \ + || die "'nvm use node' + 'nvm current' did not output '$EXPECTED_OUTPUT'; got '$OUTPUT'" + +OUTPUT="$(nvm use --silent node)" +EXPECTED_OUTPUT="" + +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \ + || die "'nvm use --silent node' output was not silenced '$EXPECTED_OUTPUT'; got '$OUTPUT'" diff --git a/test/slow/nvm use/Running'nvm use v1.0.0' uses iojs-v1.0.0 iojs version b/test/slow/nvm use/Running'nvm use v1.0.0' uses iojs-v1.0.0 iojs version new file mode 100644 index 0000000..d47a48a --- /dev/null +++ b/test/slow/nvm use/Running'nvm use v1.0.0' uses iojs-v1.0.0 iojs version @@ -0,0 +1,20 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +nvm deactivate 2>&1 >/dev/null || die 'deactivate failed' + +nvm use 'v1.0.0' || die 'nvm use v1.0.0 failed' +OUTPUT="$(nvm current)" +EXPECTED_OUTPUT="$(nvm_version v1.0.0)" + +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \ + || die "'nvm use v1.0.0' + 'nvm current' did not output '$EXPECTED_OUTPUT'; got '$OUTPUT'" + +OUTPUT="$(nvm use --silent 'v1.0.0')" +EXPECTED_OUTPUT="" + +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \ + || die "'nvm use --silent v1.0.0' output was not silenced '$EXPECTED_OUTPUT'; got '$OUTPUT'" diff --git a/test/slow/nvm use/Running'nvm use' calls 'nvm_die_on_prefix' b/test/slow/nvm use/Running'nvm use' calls 'nvm_die_on_prefix' new file mode 100644 index 0000000..2fe0de7 --- /dev/null +++ b/test/slow/nvm use/Running'nvm use' calls 'nvm_die_on_prefix' @@ -0,0 +1,22 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +nvm deactivate >/dev/null 2>&1 || die 'deactivate failed' + +nvm_die_on_prefix() { + echo >&2 "| $1 | $2 |" + return 3 +} + +OUTPUT="$(nvm use --silent node)" +EXPECTED_OUTPUT="" +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \ + || die "'nvm use --silent node' did not call through to 'nvm_die_on_prefix' and give output '$EXPECTED_OUTPUT'; got '$OUTPUT'" + +EXIT_CODE="$(nvm use --silent node >/dev/null 2>&1; echo $?)" +EXPECTED_CODE="11" +[ "_$EXIT_CODE" = "_$EXPECTED_CODE" ] \ + || die "'nvm use --silent node' when 'nvm_die_on_prefix' fails did not return '$EXPECTED_CODE'; got '$EXIT_CODE'" diff --git a/test/slow/nvm use/Running'nvm use' with nvmrc containing not installed version b/test/slow/nvm use/Running'nvm use' with nvmrc containing not installed version new file mode 100644 index 0000000..122aa96 --- /dev/null +++ b/test/slow/nvm use/Running'nvm use' with nvmrc containing not installed version @@ -0,0 +1,28 @@ +#!/bin/sh + +die () { echo "$@" ; exit 1; } + +\. ../../../nvm.sh + +nvm deactivate 2>&1 >/dev/null || die 'deactivate failed' + +echo "foo" > .nvmrc + +# running nvm use with .nvmrc should not print the version information +OUTPUT="$(nvm use 2>&1)" +EXIT_CODE=$? +EXPECTED_OUTPUT="Found '$PWD/.nvmrc' with version +N/A: version \"foo\" is not yet installed. + +You need to run \`nvm install\` to install and use the node version specified in \`.nvmrc\`." +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "expected 'nvm use' with nvmrc to give $EXPECTED_OUTPUT, got $OUTPUT" +[ "_$EXIT_CODE" = "_3" ] || die "expected 'nvm use' with nvmrc to exit with 3, got $EXIT_CODE" + +# --silent should not print anything +OUTPUT=$(nvm use --silent) +EXPECTED_OUTPUT="" + +[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \ + || die "'nvm use --silent' output was not silenced to '$EXPECTED_OUTPUT'; got '$OUTPUT'" + +rm .nvmrc diff --git a/test/slow/nvm_get_latest/nvm_get_latest failed redirect b/test/slow/nvm_get_latest/nvm_get_latest failed redirect old mode 100755 new mode 100644 diff --git a/test/slow/nvm_get_latest/nvm_get_latestfailed redirect b/test/slow/nvm_get_latest/nvm_get_latestfailed redirect new file mode 100644 index 0000000..2548b06 --- /dev/null +++ b/test/slow/nvm_get_latest/nvm_get_latestfailed redirect @@ -0,0 +1,25 @@ +#!/bin/sh + +die () { echo "$@" ; cleanup ; exit 1; } + +cleanup() { + unset -f curl wget +} + +\. ../../../nvm.sh + +curl() { + return 1 +} +wget() { + return 1 +} + +OUTPUT="$(nvm_get_latest 2>&1)" +EXIT_CODE="$(nvm_get_latest >/dev/null 2>&1 ; echo $?)" +[ "_$OUTPUT" = "_https://latest.nvm.sh did not redirect to the latest release on GitHub" ] \ + || die "failed redirect did not report correct error message, got '$OUTPUT'" +[ "_$EXIT_CODE" = "_2" ] \ + || die "failed redirect did not exit with code 2, got $EXIT_CODE" + +cleanup