summaryrefslogtreecommitdiff
path: root/tools/permission_prompt_test.ts
blob: cf8a09805cd7dd60f4b2db92dc0905c85142f8bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { args, listen, env, exit, makeTempDirSync } from "deno";

const name = args[1];
const test = {
  needsWrite: () => {
    makeTempDirSync();
  },
  needsEnv: () => {
    env().home;
  },
  needsNet: () => {
    listen("tcp", "127.0.0.1:4540");
  }
}[name];

if (!test) {
  console.log("Unknown test:", name);
  exit(1);
}

test();