Fix delete test
This commit is contained in:
parent
b41f54ad4c
commit
10b3171b9d
1 changed files with 4 additions and 1 deletions
|
@ -52,10 +52,13 @@ describe("APL", () => {
|
||||||
|
|
||||||
vi.spyOn(fsPromises, "access").mockResolvedValue();
|
vi.spyOn(fsPromises, "access").mockResolvedValue();
|
||||||
vi.spyOn(fsPromises, "readFile").mockResolvedValue(JSON.stringify(stubAuthData));
|
vi.spyOn(fsPromises, "readFile").mockResolvedValue(JSON.stringify(stubAuthData));
|
||||||
|
const spyWriteFile = vi.spyOn(fsPromises, "writeFile").mockResolvedValue();
|
||||||
|
|
||||||
const apl = new FileAPL();
|
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 () => {
|
it("Should not delete data when called with unknown domain", async () => {
|
||||||
|
|
Loading…
Reference in a new issue