rewrite bot in TypeScript and add locale switching

This commit is contained in:
Alex Getman
2026-08-12 13:12:04 +03:00
parent 905b69f568
commit 2cb8740e06
121 changed files with 5230 additions and 15333 deletions
+14
View File
@@ -0,0 +1,14 @@
import { describe, expect, test } from "bun:test";
import { mkdtempSync, rmSync } from "node:fs";
import { join } from "node:path";
import { withExclusiveFileLock } from "../src/storage/secure-files.js";
describe("file locks", () => {
test("releases the lock directory after the action", async () => {
const directory = mkdtempSync(join(process.env.TMPDIR ?? "/tmp", "miband-lock-"));
const path = join(directory, "sync.lock");
await withExclusiveFileLock(path, async () => "first");
await expect(withExclusiveFileLock(path, async () => "second")).resolves.toBe("second");
rmSync(directory, { recursive: true, force: true });
});
});