mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-26 02:31:40 +00:00
11 lines
598 B
TypeScript
11 lines
598 B
TypeScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
import { pluginAuthenticationResponseErrorMessage } from "./usePluginAuthenticationChallenges";
|
|
|
|
test("plugin authentication response errors are bounded before display", () => {
|
|
assert.equal(pluginAuthenticationResponseErrorMessage(new Error("bridge down")), "bridge down");
|
|
assert.equal(pluginAuthenticationResponseErrorMessage(" failed "), "failed");
|
|
assert.equal(pluginAuthenticationResponseErrorMessage({}), "");
|
|
assert.equal(pluginAuthenticationResponseErrorMessage(new Error("x".repeat(600))).length, 512);
|
|
});
|