Initial Commit

This commit is contained in:
2026-05-27 23:47:53 +01:00
parent fbc70f96e6
commit 9b28db724f
18103 changed files with 1600554 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import { describe, expect, it } from "@suaveplan/testing/runner";
import { BetterAuthSurrealError } from "../error-codes/error-codes.js";
import { compileSelect } from "./compile-select.js";
describe("compileSelect", () => {
it("returns * for undefined", { timeout: 5000 }, () => {
expect(compileSelect(undefined)).toBe("*");
});
it("returns * for empty array", { timeout: 5000 }, () => {
expect(compileSelect([])).toBe("*");
});
it("joins valid identifiers with comma-space", { timeout: 5000 }, () => {
expect(compileSelect(["id", "email"])).toBe("id, email");
});
it("rejects invalid identifier", { timeout: 5000 }, () => {
expect(() => compileSelect(["id", "weird-name"])).toThrow(
BetterAuthSurrealError
);
});
});