1
0
silverbullet/plug-api/lib/syscall_mock.ts
2023-07-26 17:12:56 +02:00

11 lines
280 B
TypeScript

import { YAML } from "../../common/deps.ts";
globalThis.syscall = (name: string, ...args: readonly any[]) => {
switch (name) {
case "yaml.parse":
return Promise.resolve(YAML.parse(args[0]));
default:
throw Error(`Not implemented in tests: ${name}`);
}
};