This commit is contained in:
@@ -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)));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user