summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-09-03 10:07:02 +0100
committerGitHub <noreply@github.com>2024-09-03 11:07:02 +0200
commit71e4ac774bc18902a0d23f29d9b18b43b19bbbf2 (patch)
tree751a25bf46a9eb0c0ced483877e39c3bef7b4200 /tests/unit
parentbf7571a6f93659ef087ef529225642ce85e215d4 (diff)
BREAKING(unstable): drop support for Deno.run.{clearEnv,gid,uid} (#25371)
These are unstable options and the APIs is now deprecated. To limit amount of unstable flags we elected to have these APIs removed.
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/process_test.ts96
1 files changed, 0 insertions, 96 deletions
diff --git a/tests/unit/process_test.ts b/tests/unit/process_test.ts
index 799c8d12c..a35362d09 100644
--- a/tests/unit/process_test.ts
+++ b/tests/unit/process_test.ts
@@ -583,102 +583,6 @@ Deno.test({ permissions: { run: true, read: true } }, function killFailed() {
});
Deno.test(
- { permissions: { run: true, read: true, env: true } },
- async function clearEnv(): Promise<void> {
- // deno-lint-ignore no-deprecated-deno-api
- const p = Deno.run({
- cmd: [
- Deno.execPath(),
- "eval",
- "-p",
- "JSON.stringify(Deno.env.toObject())",
- ],
- stdout: "piped",
- clearEnv: true,
- env: {
- FOO: "23147",
- },
- });
-
- const obj = JSON.parse(new TextDecoder().decode(await p.output()));
-
- // can't check for object equality because the OS may set additional env
- // vars for processes, so we check if PATH isn't present as that is a common
- // env var across OS's and isn't set for processes.
- assertEquals(obj.FOO, "23147");
- assert(!("PATH" in obj));
-
- p.close();
- },
-);
-
-Deno.test(
- {
- permissions: { run: true, read: true },
- ignore: Deno.build.os === "windows",
- },
- async function uid(): Promise<void> {
- // deno-lint-ignore no-deprecated-deno-api
- const p = Deno.run({
- cmd: [
- "id",
- "-u",
- ],
- stdout: "piped",
- });
-
- const currentUid = new TextDecoder().decode(await p.output());
- p.close();
-
- if (currentUid !== "0") {
- assertThrows(() => {
- // deno-lint-ignore no-deprecated-deno-api
- Deno.run({
- cmd: [
- "echo",
- "fhqwhgads",
- ],
- uid: 0,
- });
- }, Deno.errors.PermissionDenied);
- }
- },
-);
-
-Deno.test(
- {
- permissions: { run: true, read: true },
- ignore: Deno.build.os === "windows",
- },
- async function gid(): Promise<void> {
- // deno-lint-ignore no-deprecated-deno-api
- const p = Deno.run({
- cmd: [
- "id",
- "-g",
- ],
- stdout: "piped",
- });
-
- const currentGid = new TextDecoder().decode(await p.output());
- p.close();
-
- if (currentGid !== "0") {
- assertThrows(() => {
- // deno-lint-ignore no-deprecated-deno-api
- Deno.run({
- cmd: [
- "echo",
- "fhqwhgads",
- ],
- gid: 0,
- });
- }, Deno.errors.PermissionDenied);
- }
- },
-);
-
-Deno.test(
{
permissions: { run: true, read: true, write: true },
ignore: Deno.build.os === "windows",