mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-20 23:20:46 +00:00
31 lines
782 B
TypeScript
31 lines
782 B
TypeScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
|
|
import type { DropEntry } from "./sftpFileUtils";
|
|
import { buildZmodemDragDropFiles } from "./zmodemDragDrop";
|
|
|
|
test("ZMODEM drops use reconstructed paths without buffering the file", async () => {
|
|
let buffered = false;
|
|
const entry: DropEntry = {
|
|
file: {
|
|
name: "large.bin",
|
|
arrayBuffer: async () => {
|
|
buffered = true;
|
|
return new ArrayBuffer(0);
|
|
},
|
|
} as File,
|
|
localPath: "/tmp/large.bin",
|
|
relativePath: "large.bin",
|
|
isDirectory: false,
|
|
};
|
|
|
|
const files = await buildZmodemDragDropFiles([entry]);
|
|
|
|
assert.deepEqual(files, [{
|
|
path: "/tmp/large.bin",
|
|
name: "large.bin",
|
|
remoteName: "large.bin",
|
|
}]);
|
|
assert.equal(buffered, false);
|
|
});
|