mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-18 13:29:25 +02:00
dddd
This commit is contained in:
parent
4b1979edf7
commit
ea63a9e41b
@ -37,14 +37,16 @@ describe("Test misc", () => {
|
||||
|
||||
it.skip("test apifetch mock async", async () => {
|
||||
const spy = vi.fn();
|
||||
await apiFetch("https://localhost:8080/account/info").then(response => {
|
||||
expect(response.status).toBe(200);
|
||||
expect(response.ok).toBe(true);
|
||||
return response.json();
|
||||
}).then(data => {
|
||||
spy(); // Call the spy function
|
||||
expect(data).toEqual({ "username": "greenlamp", "lastSessionSlot": 0 });
|
||||
});
|
||||
await apiFetch("https://localhost:8080/account/info")
|
||||
.then(response => {
|
||||
expect(response.status).toBe(200);
|
||||
expect(response.ok).toBe(true);
|
||||
return response.json();
|
||||
})
|
||||
.then(data => {
|
||||
spy(); // Call the spy function
|
||||
expect(data).toEqual({ username: "greenlamp", lastSessionSlot: 0 });
|
||||
});
|
||||
expect(spy).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user