workers-rs/test/tests/snippets.spec.ts
2025-09-16 16:48:46 -07:00

17 lines
487 B
TypeScript

import { describe, test, expect } from "vitest";
import { mf, mfUrl } from "./mf";
describe("JS Snippets", () => {
test("performance.now", async () => {
const resp = await mf.dispatchFetch(`${mfUrl}js_snippets/now`);
const text = await resp.text();
expect(text).toMatch(/^now: \d+$$/);
});
test("console.log", async () => {
const resp = await mf.dispatchFetch(`${mfUrl}js_snippets/log`);
const text = await resp.text();
expect(text).toBe("OK");
});
});