fake-iamport-server
Version:
Fake iamport server for testing
19 lines (17 loc) • 477 B
text/typescript
import cp from "child_process";
import { Pair } from "tstl";
export namespace Terminal {
export function execute(
...commands: string[]
): Promise<Pair<string, string>> {
return new Promise((resolve, reject) => {
cp.exec(
commands.join(" && "),
(error: Error | null, stdout: string, stderr: string) => {
if (error) reject(error);
else resolve(new Pair(stdout, stderr));
},
);
});
}
}