-
Notifications
You must be signed in to change notification settings - Fork 485
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create `latest` alias on install * add e2e tests for `latest` * merge conditionals * Add changeset * fix clippy --------- Co-authored-by: Gal Schlezinger <[email protected]>
- Loading branch information
1 parent
1b86087
commit 7b47b3e
Showing
5 changed files
with
81 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"fnm": minor | ||
--- | ||
|
||
`fnm install latest` will now tag the `latest` alias |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Bash installs latest: Bash 1`] = ` | ||
"set -e | ||
eval "$(fnm env)" | ||
fnm install --latest | ||
(fnm ls) | grep latest || (echo "Expected output to contain latest" && exit 1) | ||
fnm use 'latest'" | ||
`; | ||
|
||
exports[`Fish installs latest: Fish 1`] = ` | ||
"fnm env | source | ||
fnm install --latest | ||
begin; fnm ls; end | grep latest; or echo "Expected output to contain latest" && exit 1 | ||
fnm use 'latest'" | ||
`; | ||
|
||
exports[`PowerShell installs latest: PowerShell 1`] = ` | ||
"$ErrorActionPreference = "Stop" | ||
fnm env | Out-String | Invoke-Expression | ||
fnm install --latest | ||
$($__out__ = $(fnm ls | Select-String latest); if ($__out__ -eq $null) { exit 1 } else { $__out__ }) | ||
fnm use 'latest'" | ||
`; | ||
|
||
exports[`Zsh installs latest: Zsh 1`] = ` | ||
"set -e | ||
eval "$(fnm env)" | ||
fnm install --latest | ||
(fnm ls) | grep latest || (echo "Expected output to contain latest" && exit 1) | ||
fnm use 'latest'" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { script } from "./shellcode/script.js" | ||
import { Bash, Fish, PowerShell, Zsh } from "./shellcode/shells.js" | ||
import describe from "./describe.js" | ||
|
||
for (const shell of [Bash, Zsh, Fish, PowerShell]) { | ||
describe(shell, () => { | ||
test(`installs latest`, async () => { | ||
await script(shell) | ||
.then(shell.env({})) | ||
.then(shell.call("fnm", ["install", "--latest"])) | ||
.then( | ||
shell.scriptOutputContains(shell.call("fnm", ["ls"]), "latest") | ||
) | ||
.then(shell.call("fnm", ["use", "'latest'"])) | ||
.takeSnapshot(shell) | ||
.execute(shell) | ||
}) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters