Fix delete test

This commit is contained in:
Krzysztof Wolski 2022-09-01 16:36:37 +02:00
parent b41f54ad4c
commit 10b3171b9d

View file

@ -52,10 +52,13 @@ describe("APL", () => {
vi.spyOn(fsPromises, "access").mockResolvedValue();
vi.spyOn(fsPromises, "readFile").mockResolvedValue(JSON.stringify(stubAuthData));
const spyWriteFile = vi.spyOn(fsPromises, "writeFile").mockResolvedValue();
const apl = new FileAPL();
expect(await apl.get(stubAuthData.domain)).toStrictEqual(stubAuthData);
await apl.delete(stubAuthData.domain);
expect(spyWriteFile).toBeCalledWith(".auth-data.json", "{}");
});
it("Should not delete data when called with unknown domain", async () => {