[Tests] improve + update test mocks
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Jordan Harband · committed by Jordan Harband · parent 702d52f · Browse files · 5 files·+10 added−4 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+10 added−4 removed
- tests:+7 added−3 removed
- other:+3 added−1 removed
Provenance
- Commit
a29d0e4- Tree
f493e03- Author
Jordan Harband <ljharb@gmail.com>- Committer
Jordan Harband <ljharb@gmail.com>- Parent
702d52f
5 files changed+10 added−4 removed
modified:test/fast/Unit tests/mocks/nodejs.org-dist-index.tab+1 added-1 removed
1 version date files npm v8 uv zlib openssl modules lts2-v6.7.0 2016-09-27 headers,linux-arm64,linux-armv6l,linux-armv7l,linux-ppc64le,linux-x64,linux-x86,osx-x64-pkg,osx-x64-tar,src,sunos-x64,sunos-x86,win-x64-msi,win-x86-msi 3.10.3 5.1.281.83 1.9.1 1.2.8 1.0.2j 48 -2+v6.7.0 2016-09-27 aix-ppc64,headers,linux-arm64,linux-armv6l,linux-armv7l,linux-ppc64le,linux-x64,linux-x86,osx-x64-pkg,osx-x64-tar,src,sunos-x64,sunos-x86,win-x64-msi,win-x86-msi 3.10.3 5.1.281.83 1.9.1 1.2.8 1.0.2j 48 -3 v6.6.0 2016-09-14 headers,linux-arm64,linux-armv6l,linux-armv7l,linux-ppc64le,linux-x64,linux-x86,osx-x64-pkg,osx-x64-tar,src,sunos-x64,sunos-x86,win-x64-msi,win-x86-msi 3.10.3 5.1.281.83 1.9.1 1.2.8 1.0.2h 48 -4 v6.5.0 2016-08-26 headers,linux-arm64,linux-armv6l,linux-armv7l,linux-ppc64le,linux-x64,linux-x86,osx-x64-pkg,osx-x64-tar,src,sunos-x64,sunos-x86,win-x64-msi,win-x86-msi 3.10.3 5.1.281.81 1.9.1 1.2.8 1.0.2h 48 -5 v6.4.0 2016-08-12 headers,linux-arm64,linux-armv6l,linux-armv7l,linux-ppc64le,linux-x64,linux-x86,osx-x64-pkg,osx-x64-tar,src,sunos-x64,sunos-x86,win-x64-msi,win-x86-msi 3.10.3 5.0.71.60 1.9.1 1.2.8 1.0.2h 48 -6 v6.3.1 2016-07-21 headers,linux-arm64,linux-armv6l,linux-armv7l,linux-ppc64le,linux-x64,linux-x86,osx-x64-pkg,osx-x64-tar,src,sunos-x64,sunos-x86,win-x64-msi,win-x86-msi 3.10.3 5.0.71.57 1.9.1 1.2.8 1.0.2h 48 -283 unmodified linesadded:test/fast/Unit tests/mocks/nvm_ls_remote stable.txt+1 added
1+v6.7.0added:test/fast/Unit tests/mocks/nvm_print_implicit_alias remote stable.txt+1 added
1+6.7modified:test/fast/Unit tests/nvm_ls_remote+4 added-2 removed
40 unmodified lines41 [ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm_ls_remote 0.3 did not output 0.3.x versions; got $OUTPUT"42 43 # Sanity checks44 OUTPUT="$(nvm_print_implicit_alias remote stable)"45-EXPECTED_OUTPUT="6.7"45+EXPECTED_OUTPUT_PATH="${MOCKS_DIR}/nvm_print_implicit_alias remote stable.txt"46+EXPECTED_OUTPUT="$(cat "${EXPECTED_OUTPUT_PATH}")"47 [ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm_print_implicit_alias remote stable did not output $EXPECTED_OUTPUT; got $OUTPUT"48 49 OUTPUT="$(nvm_print_implicit_alias remote unstable)"50 EXPECTED_OUTPUT="0.11"51 [ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm_print_implicit_alias remote unstable did not output $EXPECTED_OUTPUT; got $OUTPUT"52 53 OUTPUT="$(nvm_ls_remote stable)"53-EXPECTED_OUTPUT="v6.7.0"54+EXPECTED_OUTPUT_PATH="${MOCKS_DIR}/nvm_ls_remote stable.txt"55+EXPECTED_OUTPUT="$(cat "${EXPECTED_OUTPUT_PATH}")"56 [ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm_ls_remote stable did not output $EXPECTED_OUTPUT; got $OUTPUT"57 58 OUTPUT="$(nvm_ls_remote unstable)"59 EXPECTED_OUTPUT="v0.11.16"14 unmodified linesmodified:update_test_mocks.sh+3 added-1 removed
28 unmodified lines293031323334353637383940414042434428 unmodified linesnvm ls-remote > "$MOCKS_DIR/nvm ls-remote.txt"nvm ls-remote --lts > "$MOCKS_DIR/nvm ls-remote lts.txt"nvm ls-remote node > "$MOCKS_DIR/nvm ls-remote node.txt"nvm ls-remote iojs > "$MOCKS_DIR/nvm ls-remote iojs.txt"nvm_print_implicit_alias remote stable > "$MOCKS_DIR/nvm_print_implicit_alias remote stable.txt"nvm_ls_remote stable > "$MOCKS_DIR/nvm_ls_remote stable.txt"
ALIAS_PATH="$MOCKS_DIR/nvm_make_alias LTS alias calls.txt": > "$ALIAS_PATH"nvm_make_alias() { # prevent local alias creation, and store arguments echo "${1}|${2}" >> "$ALIAS_PATH"}nvm ls-remote --ltsnvm ls-remote --lts > /dev/null
echo "done! Don't forget to git commit them."