import { describe, beforeEach, it, expect } from 'vitest';
import Async from './async';

describe('Async', () => {
  let myAsync: Async;
  beforeEach(() => {
    myAsync = new Async();
  });

  it('should work with callback', () =>
    new Promise<void>((done) => {
      myAsync.withCallback((value) => {
        expect(value).toBe('Hello World');
        done();
      });
    }));

  it('should work with promises', async () => {
    const value = await myAsync.withPromise();
    expect(value).toBe('Hello World');
  });
});
