Complete worked example
typescript
import { test, expect } from "../support/test.js";
test("cleanup resets only its test namespace", async ({request}) => {
await request.post("/api/login", {data:{user:"alice"}});
await request.put("/api/saved/r1");
expect(await (await request.get("/api/saved")).json()).toEqual({ids:["r1"]});
await request.delete("/__test/namespace");
expect(await (await request.get("/api/saved")).json()).toEqual({ids:[]});
});- Reasoning
- The reset targets one synthetic namespace and is not a production cleanup mechanism.