test: Split test utilities to improve test times (#2622)

This commit is contained in:
Dermot Duffy
2026-07-26 16:29:53 -07:00
committed by GitHub
parent 8d44fcecf1
commit ad89aa9538
234 changed files with 2730 additions and 2516 deletions
+4 -4
View File
@@ -8,10 +8,10 @@ describe('onAbort', () => {
const cb = vi.fn();
onAbort(ac.signal, cb);
expect(cb).not.toBeCalled();
expect(cb).not.toHaveBeenCalled();
ac.abort();
expect(cb).toBeCalledTimes(1);
expect(cb).toHaveBeenCalledTimes(1);
});
it('should call the callback synchronously if the signal is already aborted', () => {
@@ -21,7 +21,7 @@ describe('onAbort', () => {
const cb = vi.fn();
onAbort(ac.signal, cb);
expect(cb).toBeCalledTimes(1);
expect(cb).toHaveBeenCalledTimes(1);
});
it('should fire only once even if the signal aborts repeatedly', () => {
@@ -35,6 +35,6 @@ describe('onAbort', () => {
// no-op too.
ac.signal.dispatchEvent(new Event('abort'));
expect(cb).toBeCalledTimes(1);
expect(cb).toHaveBeenCalledTimes(1);
});
});