Zeb Piasecki 7fc81655de chore: switch to miniflare3 using vitest
Updates CI to use miniflare 3 when testing against worker-sandbox using
vitest instead of Cargo's built in test runner.
2023-06-13 09:40:22 -07:00

46 lines
1.2 KiB
TypeScript

import { describe, test, expect } from "vitest";
import { mf } from "./mf";
describe("r2", () => {
test("list empty", async () => {
const resp = await mf.dispatchFetch("https://fake.host/r2/list-empty");
expect(await resp.text()).toBe("ok");
});
test("list", async () => {
const resp = await mf.dispatchFetch("https://fake.host/r2/list");
expect(await resp.text()).toBe("ok");
});
test("get empty", async () => {
const resp = await mf.dispatchFetch("https://fake.host/r2/get-empty");
expect(await resp.text()).toBe("ok");
});
test("get", async () => {
const resp = await mf.dispatchFetch("https://fake.host/r2/get");
expect(await resp.text()).toBe("ok");
});
test("put", async () => {
const resp = await mf.dispatchFetch("https://fake.host/r2/put", {
method: "put",
});
expect(await resp.text()).toBe("ok");
});
test("put properties", async () => {
const resp = await mf.dispatchFetch("https://fake.host/r2/put-properties", {
method: "put",
});
expect(await resp.text()).toBe("ok");
});
test("delete", async () => {
const resp = await mf.dispatchFetch("https://fake.host/r2/delete", {
method: "delete",
});
expect(await resp.text()).toBe("ok");
});
});