1
0
silverbullet/plug-api/lib/syscall_mock.ts

11 lines
279 B
TypeScript
Raw Normal View History

2023-07-26 15:12:56 +00:00
import { YAML } from "../../common/deps.ts";
globalThis.syscall = (name: string, ...args: readonly any[]) => {
switch (name) {
case "yaml.parse":
2023-11-29 15:51:28 +00:00
return Promise.resolve(YAML.load(args[0]));
2023-07-26 15:12:56 +00:00
default:
throw Error(`Not implemented in tests: ${name}`);
}
};