import { describe, expect, it } from 'vitest';

describe('Vitest abort-controller realm', () => {
  it('provides a global signal accepted by Node native Request', () => {
    const controller = new AbortController();
    const request = new Request('https://mosaic.invalid/navigation', {
      signal: controller.signal,
    });

    expect(request.signal).toBeInstanceOf(AbortSignal);
    controller.abort();
    expect(request.signal.aborted).toBe(true);
  });
});
