Files
Netcatty/domain/sftpStatError.test.ts
T
bincxz 927feb9c79 fix(sftp): treat IPC-wrapped lstat absence as no conflict
After #2955, upload conflict checks lstat the destination first.
New files throw ssh2's "No such file"; Electron invoke strips `code`
and wraps the message, so isMissingStatError treated absence as a
hard error and every new upload toasted.
2026-08-14 20:20:04 +08:00

14 lines
433 B
TypeScript

import assert from "node:assert/strict";
import test from "node:test";
import { isMissingStatError } from "./sftpStatError";
test("isMissingStatError recognizes ssh2 and Electron-wrapped absence", () => {
assert.equal(isMissingStatError(new Error("No such file")), true);
assert.equal(
isMissingStatError(
new Error("Error invoking remote method 'netcatty:sftp:lstat': Error: No such file"),
),
true,
);
});