Skip to content
Myr

nvm_make_alias

This file

Path

test/fast/Unit tests/nvm_make_alias

20 lines · 737 bytes

Last changed by

[Tests] add `try`/`try_err` helpers; convert tests to use themJordan Harbandbefore adoption14d01c6

History of this file

Take it

The walk stopped after 200 commits: lines older than 5c12680 point at it.

[Dev Deps] update `markdown-link-check`Jordan Harbandbefore adoption5c12680

lines 1–4why, one step back
1#!/bin/sh
23die () { echo "$@" ; exit 1; }4

[Tests] set `$_` before sourcing `nvm.sh` in fast testsJordan Harbandbefore adoptionc451e7a

line 5why, one step back
5: nvm.sh

[Dev Deps] update `markdown-link-check`Jordan Harbandbefore adoption5c12680

lines 6–7why, one step back
6\. ../../../nvm.sh
7

[Tests] add `try`/`try_err` helpers; convert tests to use themJordan Harbandbefore adoption14d01c6

lines 8–10why, one step back
8\. ../../common.sh
910try_err nvm_make_alias

[Dev Deps] update `markdown-link-check`Jordan Harbandbefore adoption5c12680

lines 11–12why, one step back
11EXPECTED_OUTPUT='an alias name is required'
12

[Tests] add `try`/`try_err` helpers; convert tests to use themJordan Harbandbefore adoption14d01c6

lines 13–14why, one step back
13[ "_$CAPTURED_STDERR" = "_$EXPECTED_OUTPUT" ] || die "\`nvm_make_alias\` did not error with '$EXPECTED_OUTPUT'; got '$CAPTURED_STDERR'"
14[ "$CAPTURED_EXIT_CODE" -eq 1 ] || die "\`nvm_make_alias\` did not exit with 1, got '$CAPTURED_EXIT_CODE'"

[Dev Deps] update `markdown-link-check`Jordan Harbandbefore adoption5c12680

line 15why, one step back
15

[Tests] add `try`/`try_err` helpers; convert tests to use themJordan Harbandbefore adoption14d01c6

line 16why, one step back
16try_err nvm_make_alias foo

[Dev Deps] update `markdown-link-check`Jordan Harbandbefore adoption5c12680

lines 17–18why, one step back
17EXPECTED_OUTPUT='an alias target version is required'
18

[Tests] add `try`/`try_err` helpers; convert tests to use themJordan Harbandbefore adoption14d01c6

lines 19–20why, one step back
19[ "_$CAPTURED_STDERR" = "_$EXPECTED_OUTPUT" ] || die "\`nvm_make_alias foo\` did not error with '$EXPECTED_OUTPUT'; got '$CAPTURED_STDERR'"
20[ "$CAPTURED_EXIT_CODE" -eq 2 ] || die "\`nvm_make_alias foo\` did not exit with 2, got '$CAPTURED_EXIT_CODE'"