Refactor code structure for improved readability and maintainability
Some checks failed
CI / lint (push) Failing after 10s
CI / test-backend (push) Has been skipped
CI / test-frontend (push) Has been skipped
CI / test-e2e (push) Has been skipped

This commit is contained in:
2026-03-22 11:34:38 +01:00
parent 5eaf320fc5
commit 2667e11284
46 changed files with 4949 additions and 157 deletions

View File

@@ -9,7 +9,9 @@ vi.mock('../../src/services/archiveReader', () => ({ listArchiveEntries: vi.fn()
import scanDirectory from '../../src/services/fsScanner';
import { listArchiveEntries } from '../../src/services/archiveReader';
afterEach(() => vi.restoreAllMocks());
afterEach(() => {
vi.restoreAllMocks();
});
it('expone entradas internas de archivos como items virtuales', async () => {
const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'fsScanner-test-'));
@@ -26,11 +28,13 @@ it('expone entradas internas de archivos como items virtuales', async () => {
const found = results.find((r: any) => r.path === expectedPath);
expect(found).toBeDefined();
expect(found.isArchiveEntry).toBe(true);
expect(found.containerPath).toBe(collectionFile);
expect(found.entryPath).toBe('inner/rom1.bin');
expect(found.filename).toBe('rom1.bin');
expect(found.format).toBe('bin');
if (found) {
expect(found.isArchiveEntry).toBe(true);
expect(found.containerPath).toBe(collectionFile);
expect(found.entryPath).toBe('inner/rom1.bin');
expect(found.filename).toBe('rom1.bin');
expect(found.format).toBe('bin');
}
await fs.rm(tmpDir, { recursive: true, force: true });
});