From d6c12d5ed8e44a9787694183c911982f62bb3cbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Wed, 3 Jan 2024 17:55:06 -0500 Subject: [PATCH] test(api): create a way to check current working directory --- server/api/dev/testing/tmpdir.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 server/api/dev/testing/tmpdir.ts diff --git a/server/api/dev/testing/tmpdir.ts b/server/api/dev/testing/tmpdir.ts new file mode 100644 index 0000000..fb7381a --- /dev/null +++ b/server/api/dev/testing/tmpdir.ts @@ -0,0 +1,13 @@ +import { log } from "@server/logger"; +import * as fs from "fs"; + +export default eventHandler(async (ev) => { + try { + fs.readFileSync("tmp/.gitkeep"); + } catch (e) { + log.error(e); + } + return { + cwd: process.cwd(), + }; +});