You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
1.8 KiB
72 lines
1.8 KiB
![]()
2 years ago
|
import { script } from "./shellcode/script"
|
||
|
import { Bash, Fish, PowerShell, Zsh } from "./shellcode/shells"
|
||
|
import describe from "./describe"
|
||
|
import getStderr from "./shellcode/get-stderr"
|
||
|
|
||
|
for (const shell of [Bash, Zsh, Fish, PowerShell]) {
|
||
|
describe(shell, () => {
|
||
|
test(`"quiet" log level`, async () => {
|
||
|
await script(shell)
|
||
|
.then(shell.env({ logLevel: "quiet" }))
|
||
|
.then(
|
||
|
shell.hasCommandOutput(
|
||
|
shell.call("fnm", ["install", "v8.11.3"]),
|
||
|
"",
|
||
|
"fnm install"
|
||
|
)
|
||
|
)
|
||
|
.then(
|
||
|
shell.hasCommandOutput(
|
||
|
shell.call("fnm", ["use", "v8.11.3"]),
|
||
|
"",
|
||
|
"fnm use"
|
||
|
)
|
||
|
)
|
||
|
.then(
|
||
|
shell.hasCommandOutput(
|
||
|
shell.call("fnm", ["alias", "v8.11.3", "something"]),
|
||
|
"",
|
||
|
"fnm alias"
|
||
|
)
|
||
|
)
|
||
|
.takeSnapshot(shell)
|
||
|
.execute(shell)
|
||
|
})
|
||
|
|
||
|
test("error log level", async () => {
|
||
|
await script(shell)
|
||
|
.then(shell.env({ logLevel: "error" }))
|
||
|
.then(
|
||
|
shell.hasCommandOutput(
|
||
|
shell.call("fnm", ["install", "v8.11.3"]),
|
||
|
"",
|
||
|
"fnm install"
|
||
|
)
|
||
|
)
|
||
|
.then(
|
||
|
shell.hasCommandOutput(
|
||
|
shell.call("fnm", ["use", "v8.11.3"]),
|
||
|
"",
|
||
|
"fnm use"
|
||
|
)
|
||
|
)
|
||
|
.then(
|
||
|
shell.hasCommandOutput(
|
||
|
shell.call("fnm", ["alias", "v8.11.3", "something"]),
|
||
|
"",
|
||
|
"fnm alias"
|
||
|
)
|
||
|
)
|
||
|
.then(
|
||
|
shell.scriptOutputContains(
|
||
|
getStderr(shell.call("fnm", ["alias", "abcd", "efg"])),
|
||
|
`"find requested version"`
|
||
|
)
|
||
|
)
|
||
|
|
||
|
.takeSnapshot(shell)
|
||
|
.execute(shell)
|
||
|
})
|
||
|
})
|
||
|
}
|