@hyper-fetch/core
Version:
Cache, Queue and Persist your requests no matter if you are online or offline!
12 lines (10 loc) • 318 B
text/typescript
import type { Mock } from "vitest";
export const testCallbacksExecution = (callbacks: Array<Mock>) => {
callbacks.forEach((spyFn, index) => {
const nextSpy = callbacks[index + 1];
if (nextSpy) {
expect(spyFn).toHaveBeenCalledBefore(nextSpy);
}
expect(spyFn).toHaveBeenCalledTimes(1);
});
};