mirror of
https://github.com/gentoo-mirror/guru.git
synced 2025-04-20 00:08:58 -04:00
Closes: https://bugs.gentoo.org/937363 Signed-off-by: Alexey Zapparov <alexey@zapparov.com>
272 lines
11 KiB
Diff
272 lines
11 KiB
Diff
Skip Windows-related tests
|
|
diff --git a/e2e/aliases.test.ts b/e2e/aliases.test.ts
|
|
index e7dce18..6c437c2 100644
|
|
--- a/e2e/aliases.test.ts
|
|
+++ b/e2e/aliases.test.ts
|
|
@@ -1,5 +1,5 @@
|
|
import { script } from "./shellcode/script.js"
|
|
-import { Bash, Fish, PowerShell, Zsh } from "./shellcode/shells.js"
|
|
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
|
|
import describe from "./describe.js"
|
|
import { writeFile } from "node:fs/promises"
|
|
import path from "node:path"
|
|
@@ -7,7 +7,7 @@ import testCwd from "./shellcode/test-cwd.js"
|
|
import getStderr from "./shellcode/get-stderr.js"
|
|
import testNodeVersion from "./shellcode/test-node-version.js"
|
|
|
|
-for (const shell of [Bash, Zsh, Fish, PowerShell]) {
|
|
+for (const shell of [Bash, Zsh, Fish]) {
|
|
describe(shell, () => {
|
|
test(`allows to install an lts if version missing`, async () => {
|
|
await writeFile(path.join(testCwd(), ".node-version"), "lts/*")
|
|
diff --git a/e2e/basic.test.ts b/e2e/basic.test.ts
|
|
index 17040d0..b64a717 100644
|
|
--- a/e2e/basic.test.ts
|
|
+++ b/e2e/basic.test.ts
|
|
@@ -1,12 +1,12 @@
|
|
import { writeFile, mkdir } from "node:fs/promises"
|
|
import { join } from "node:path"
|
|
import { script } from "./shellcode/script.js"
|
|
-import { Bash, Fish, PowerShell, WinCmd, Zsh } from "./shellcode/shells.js"
|
|
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
|
|
import testCwd from "./shellcode/test-cwd.js"
|
|
import testNodeVersion from "./shellcode/test-node-version.js"
|
|
import describe from "./describe.js"
|
|
|
|
-for (const shell of [Bash, Zsh, Fish, PowerShell, WinCmd]) {
|
|
+for (const shell of [Bash, Zsh, Fish]) {
|
|
describe(shell, () => {
|
|
test(`basic usage`, async () => {
|
|
await script(shell)
|
|
diff --git a/e2e/corepack.test.ts b/e2e/corepack.test.ts
|
|
index 6917ea1..a3503e9 100644
|
|
--- a/e2e/corepack.test.ts
|
|
+++ b/e2e/corepack.test.ts
|
|
@@ -1,6 +1,6 @@
|
|
import fs from "fs"
|
|
import { script } from "./shellcode/script.js"
|
|
-import { Bash, Fish, PowerShell, Zsh } from "./shellcode/shells.js"
|
|
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
|
|
import describe from "./describe.js"
|
|
import path from "path"
|
|
import testCwd from "./shellcode/test-cwd.js"
|
|
@@ -28,7 +28,7 @@ const nodescript = `
|
|
}
|
|
`
|
|
|
|
-for (const shell of [Bash, Fish, PowerShell, Zsh]) {
|
|
+for (const shell of [Bash, Fish, Zsh]) {
|
|
describe(shell, () => {
|
|
test(`installs corepack`, async () => {
|
|
const cwd = testCwd()
|
|
diff --git a/e2e/current.test.ts b/e2e/current.test.ts
|
|
index 29710c0..430de0f 100644
|
|
--- a/e2e/current.test.ts
|
|
+++ b/e2e/current.test.ts
|
|
@@ -1,8 +1,8 @@
|
|
import { script } from "./shellcode/script.js"
|
|
-import { Bash, Fish, PowerShell, WinCmd, Zsh } from "./shellcode/shells.js"
|
|
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
|
|
import describe from "./describe.js"
|
|
|
|
-for (const shell of [Bash, Zsh, Fish, PowerShell, WinCmd]) {
|
|
+for (const shell of [Bash, Zsh, Fish]) {
|
|
describe(shell, () => {
|
|
test(`current returns the current Node.js version set in fnm`, async () => {
|
|
await script(shell)
|
|
diff --git a/e2e/env.test.ts b/e2e/env.test.ts
|
|
index 4c056c8..1ce5a62 100644
|
|
--- a/e2e/env.test.ts
|
|
+++ b/e2e/env.test.ts
|
|
@@ -1,11 +1,11 @@
|
|
import { readFile } from "node:fs/promises"
|
|
import { join } from "node:path"
|
|
import { script } from "./shellcode/script.js"
|
|
-import { Bash, Fish, PowerShell, WinCmd, Zsh } from "./shellcode/shells.js"
|
|
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
|
|
import testCwd from "./shellcode/test-cwd.js"
|
|
import describe from "./describe.js"
|
|
|
|
-for (const shell of [Bash, Zsh, Fish, PowerShell, WinCmd]) {
|
|
+for (const shell of [Bash, Zsh, Fish]) {
|
|
describe(shell, () => {
|
|
test(`outputs json`, async () => {
|
|
const filename = `file.json`
|
|
diff --git a/e2e/exec.test.ts b/e2e/exec.test.ts
|
|
index 4babaad..6d93b59 100644
|
|
--- a/e2e/exec.test.ts
|
|
+++ b/e2e/exec.test.ts
|
|
@@ -1,11 +1,11 @@
|
|
import { script } from "./shellcode/script.js"
|
|
-import { Bash, Fish, PowerShell, WinCmd, Zsh } from "./shellcode/shells.js"
|
|
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
|
|
import testCwd from "./shellcode/test-cwd.js"
|
|
import fs from "node:fs/promises"
|
|
import path from "node:path"
|
|
import describe from "./describe.js"
|
|
|
|
-for (const shell of [Bash, Zsh, Fish, PowerShell, WinCmd]) {
|
|
+for (const shell of [Bash, Zsh, Fish]) {
|
|
describe(shell, () => {
|
|
test("`exec` usage", async () => {
|
|
await fs.writeFile(path.join(testCwd(), ".nvmrc"), "v8.10.0")
|
|
diff --git a/e2e/existing-installation.test.ts b/e2e/existing-installation.test.ts
|
|
index 2fb0f90..17140da 100644
|
|
--- a/e2e/existing-installation.test.ts
|
|
+++ b/e2e/existing-installation.test.ts
|
|
@@ -1,9 +1,9 @@
|
|
import getStderr from "./shellcode/get-stderr.js"
|
|
import { script } from "./shellcode/script.js"
|
|
-import { Bash, Fish, PowerShell, Zsh } from "./shellcode/shells.js"
|
|
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
|
|
import describe from "./describe.js"
|
|
|
|
-for (const shell of [Bash, Zsh, Fish, PowerShell]) {
|
|
+for (const shell of [Bash, Zsh, Fish]) {
|
|
describe(shell, () => {
|
|
test(`warns about an existing installation`, async () => {
|
|
await script(shell)
|
|
diff --git a/e2e/latest-lts.test.ts b/e2e/latest-lts.test.ts
|
|
index 83bebb0..1632b0a 100644
|
|
--- a/e2e/latest-lts.test.ts
|
|
+++ b/e2e/latest-lts.test.ts
|
|
@@ -1,8 +1,8 @@
|
|
import { script } from "./shellcode/script.js"
|
|
-import { Bash, Fish, PowerShell, Zsh } from "./shellcode/shells.js"
|
|
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
|
|
import describe from "./describe.js"
|
|
|
|
-for (const shell of [Bash, Zsh, Fish, PowerShell]) {
|
|
+for (const shell of [Bash, Zsh, Fish]) {
|
|
describe(shell, () => {
|
|
test(`installs latest lts`, async () => {
|
|
await script(shell)
|
|
diff --git a/e2e/latest.test.ts b/e2e/latest.test.ts
|
|
index 8d2a0fd..2ea4a15 100644
|
|
--- a/e2e/latest.test.ts
|
|
+++ b/e2e/latest.test.ts
|
|
@@ -1,8 +1,8 @@
|
|
import { script } from "./shellcode/script.js"
|
|
-import { Bash, Fish, PowerShell, Zsh } from "./shellcode/shells.js"
|
|
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
|
|
import describe from "./describe.js"
|
|
|
|
-for (const shell of [Bash, Zsh, Fish, PowerShell]) {
|
|
+for (const shell of [Bash, Zsh, Fish]) {
|
|
describe(shell, () => {
|
|
test(`installs latest`, async () => {
|
|
await script(shell)
|
|
diff --git a/e2e/log-level.test.ts b/e2e/log-level.test.ts
|
|
index f7329c8..2b9f9f7 100644
|
|
--- a/e2e/log-level.test.ts
|
|
+++ b/e2e/log-level.test.ts
|
|
@@ -1,9 +1,9 @@
|
|
import { script } from "./shellcode/script.js"
|
|
-import { Bash, Fish, PowerShell, Zsh } from "./shellcode/shells.js"
|
|
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
|
|
import describe from "./describe.js"
|
|
import getStderr from "./shellcode/get-stderr.js"
|
|
|
|
-for (const shell of [Bash, Zsh, Fish, PowerShell]) {
|
|
+for (const shell of [Bash, Zsh, Fish]) {
|
|
describe(shell, () => {
|
|
test(`"quiet" log level`, async () => {
|
|
await script(shell)
|
|
diff --git a/e2e/multishell.test.ts b/e2e/multishell.test.ts
|
|
index 60f9007..b1b54de 100644
|
|
--- a/e2e/multishell.test.ts
|
|
+++ b/e2e/multishell.test.ts
|
|
@@ -1,9 +1,9 @@
|
|
import { script } from "./shellcode/script.js"
|
|
-import { Bash, Fish, PowerShell, Zsh } from "./shellcode/shells.js"
|
|
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
|
|
import testNodeVersion from "./shellcode/test-node-version.js"
|
|
import describe from "./describe.js"
|
|
|
|
-for (const shell of [Bash, Zsh, Fish, PowerShell]) {
|
|
+for (const shell of [Bash, Zsh, Fish]) {
|
|
describe(shell, () => {
|
|
test(`multishell changes don't affect parent`, async () => {
|
|
await script(shell)
|
|
diff --git a/e2e/nvmrc-lts.test.ts b/e2e/nvmrc-lts.test.ts
|
|
index be5a18d..43c82e1 100644
|
|
--- a/e2e/nvmrc-lts.test.ts
|
|
+++ b/e2e/nvmrc-lts.test.ts
|
|
@@ -1,11 +1,11 @@
|
|
import { script } from "./shellcode/script.js"
|
|
-import { Bash, Fish, PowerShell, Zsh } from "./shellcode/shells.js"
|
|
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
|
|
import fs from "node:fs/promises"
|
|
import path from "node:path"
|
|
import describe from "./describe.js"
|
|
import testCwd from "./shellcode/test-cwd.js"
|
|
|
|
-for (const shell of [Bash, Fish, PowerShell, Zsh]) {
|
|
+for (const shell of [Bash, Fish, Zsh]) {
|
|
describe(shell, () => {
|
|
test(`uses .nvmrc with lts definition`, async () => {
|
|
await fs.writeFile(path.join(testCwd(), ".nvmrc"), `lts/dubnium`)
|
|
diff --git a/e2e/system-node.test.ts b/e2e/system-node.test.ts
|
|
index 67fd535..7ca0b1c 100644
|
|
--- a/e2e/system-node.test.ts
|
|
+++ b/e2e/system-node.test.ts
|
|
@@ -1,12 +1,12 @@
|
|
import { script } from "./shellcode/script.js"
|
|
-import { Bash, Fish, PowerShell, WinCmd, Zsh } from "./shellcode/shells.js"
|
|
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
|
|
import fs from "node:fs/promises"
|
|
import path from "node:path"
|
|
import describe from "./describe.js"
|
|
import testNodeVersion from "./shellcode/test-node-version.js"
|
|
import testBinDir from "./shellcode/test-bin-dir.js"
|
|
|
|
-for (const shell of [Bash, Fish, PowerShell, WinCmd, Zsh]) {
|
|
+for (const shell of [Bash, Fish, Zsh]) {
|
|
describe(shell, () => {
|
|
// latest bash breaks this as it seems. gotta find a solution.
|
|
const t = process.platform === "darwin" && shell === Bash ? test.skip : test
|
|
@@ -45,7 +45,7 @@ for (const shell of [Bash, Fish, PowerShell, WinCmd, Zsh]) {
|
|
|
|
async function writeCustomNode() {
|
|
const customNode = path.join(testBinDir(), "node")
|
|
- if (process.platform === "win32" && [WinCmd, PowerShell].includes(shell)) {
|
|
+ if (process.platform === "win32" && [WinCmd].includes(shell)) {
|
|
await fs.writeFile(customNode + ".cmd", "@echo custom")
|
|
} else {
|
|
await fs.writeFile(customNode, `#!/bin/bash\n\necho "custom"\n`)
|
|
diff --git a/e2e/uninstall.test.ts b/e2e/uninstall.test.ts
|
|
index 6726c3e..5d55ae2 100644
|
|
--- a/e2e/uninstall.test.ts
|
|
+++ b/e2e/uninstall.test.ts
|
|
@@ -1,8 +1,8 @@
|
|
import { script } from "./shellcode/script.js"
|
|
-import { Bash, Fish, PowerShell, Zsh } from "./shellcode/shells.js"
|
|
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
|
|
import describe from "./describe.js"
|
|
|
|
-for (const shell of [Bash, Zsh, Fish, PowerShell]) {
|
|
+for (const shell of [Bash, Zsh, Fish]) {
|
|
describe(shell, () => {
|
|
test(`uninstalls a version`, async () => {
|
|
await script(shell)
|
|
diff --git a/e2e/windows-scoop.test.ts b/e2e/windows-scoop.test.ts
|
|
index 5b62c48..0954e0a 100644
|
|
--- a/e2e/windows-scoop.test.ts
|
|
+++ b/e2e/windows-scoop.test.ts
|
|
@@ -1,5 +1,5 @@
|
|
import { script } from "./shellcode/script.js"
|
|
-import { Bash, Fish, PowerShell, WinCmd, Zsh } from "./shellcode/shells.js"
|
|
+import { Bash, Fish, Zsh } from "./shellcode/shells.js"
|
|
import testNodeVersion from "./shellcode/test-node-version.js"
|
|
import describe from "./describe.js"
|
|
import os from "node:os"
|
|
@@ -18,7 +18,7 @@ if (os.platform() !== "win32") {
|
|
])
|
|
})
|
|
|
|
- for (const shell of [Bash, Zsh, Fish, PowerShell, WinCmd]) {
|
|
+ for (const shell of [Bash, Zsh, Fish]) {
|
|
describe(shell, () => {
|
|
test(`scoop shims infer the shell`, async () => {
|
|
await script(shell)
|