mirror of
https://github.com/denoland/deno.git
synced 2024-10-30 09:08:00 -04:00
22 lines
338 B
TypeScript
22 lines
338 B
TypeScript
|
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();
|