mirror of
https://github.com/cloudflare/workers-rs.git
synced 2026-02-01 14:36:45 +00:00
Updates CI to use miniflare 3 when testing against worker-sandbox using vitest instead of Cargo's built in test runner.
46 lines
1.2 KiB
TypeScript
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");
|
|
});
|
|
});
|