refactor(download): refactor download module
test / test (push) Failing after 3m2s

This commit is contained in:
2026-10-27 01:02:12 +03:00
parent 188fcc8e4c
commit d91021982a
7 changed files with 105 additions and 79 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ import { existsSync, mkdtempSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import test from "node:test";
import { Downloader } from "../dist/index.mjs";
import { download } from "../dist/index.mjs";
const resolveTargetDir = () => mkdtempSync(join(tmpdir(), "test-"));
@@ -16,7 +16,7 @@ const TEST_DATA = {
for (const [url, file] of Object.entries(TEST_DATA)) {
test(`Test download: ${url}`, async () => {
const target = resolveTargetDir();
await Downloader.download(url, target);
await download(url, target);
assert(existsSync(join(target, file)));
});
}