import { describe, it, expect } from 'vitest';
import path from 'path';
import { computeHashes } from '../../src/services/checksumService';

const fixturesDir = path.join(__dirname, '..', 'fixtures');
const simpleRom = path.join(fixturesDir, 'simple-rom.bin');

describe('services/checksumService', () => {
  it('exporta computeHashes', () => {
    expect(typeof computeHashes).toBe('function');
  });

  it('calcula hashes', async () => {
    const meta = await computeHashes(simpleRom);
    expect(meta).toBeDefined();
    expect(meta.size).toBeGreaterThan(0);
    expect(meta.md5).toBeDefined();
    expect(meta.sha1).toBeDefined();
    expect(meta.crc32).toBeDefined();
  });
});
