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

@@ -10,7 +10,9 @@ const vitest_1 = require("vitest");
vitest_1.vi.mock('../../src/services/archiveReader', () => ({ listArchiveEntries: vitest_1.vi.fn() }));
const fsScanner_1 = __importDefault(require("../../src/services/fsScanner"));
const archiveReader_1 = require("../../src/services/archiveReader");
(0, vitest_1.afterEach)(() => vitest_1.vi.restoreAllMocks());
(0, vitest_1.afterEach)(() => {
vitest_1.vi.restoreAllMocks();
});
(0, vitest_1.it)('expone entradas internas de archivos como items virtuales', async () => {
const tmpDir = await fs_1.promises.mkdtemp(path_1.default.join(os_1.default.tmpdir(), 'fsScanner-test-'));
const collectionFile = path_1.default.join(tmpDir, 'collection.zip');
@@ -22,11 +24,13 @@ const archiveReader_1 = require("../../src/services/archiveReader");
const expectedPath = `${collectionFile}::inner/rom1.bin`;
const found = results.find((r) => r.path === expectedPath);
(0, vitest_1.expect)(found).toBeDefined();
(0, vitest_1.expect)(found.isArchiveEntry).toBe(true);
(0, vitest_1.expect)(found.containerPath).toBe(collectionFile);
(0, vitest_1.expect)(found.entryPath).toBe('inner/rom1.bin');
(0, vitest_1.expect)(found.filename).toBe('rom1.bin');
(0, vitest_1.expect)(found.format).toBe('bin');
if (found) {
(0, vitest_1.expect)(found.isArchiveEntry).toBe(true);
(0, vitest_1.expect)(found.containerPath).toBe(collectionFile);
(0, vitest_1.expect)(found.entryPath).toBe('inner/rom1.bin');
(0, vitest_1.expect)(found.filename).toBe('rom1.bin');
(0, vitest_1.expect)(found.format).toBe('bin');
}
await fs_1.promises.rm(tmpDir, { recursive: true, force: true });
});
(0, vitest_1.it)('ignora entradas con traversal o paths absolutos', async () => {