源码快照 @ 2026-09-02 (source-only, 剔除非源码素材)
This commit is contained in:
commit
04bac1f6e2
2200 files changed
+489415
No files matched your search
@@ -0,0 +1,42 @@
|
||||
import { spawnSync } from "node:child_process";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { expect } from "vitest";
|
||||
import { test } from "@openwork/testkit";
|
||||
|
||||
const repoRoot = fileURLToPath(new URL("../../", import.meta.url));
|
||||
|
||||
function runDenWebBunTest(file: string, expectedPasses: number) {
|
||||
const unit = spawnSync("pnpm", [
|
||||
"--dir",
|
||||
"ee/apps/den-web",
|
||||
"exec",
|
||||
"bun",
|
||||
"--conditions=development",
|
||||
"test",
|
||||
file,
|
||||
], { cwd: repoRoot, encoding: "utf8" });
|
||||
const output = `${unit.stdout}${unit.stderr}`;
|
||||
expect(unit.error, output).toBeUndefined();
|
||||
expect(unit.status, output).toBe(0);
|
||||
expect(output).toContain(` ${expectedPasses} pass`);
|
||||
expect(output).toContain(" 0 fail");
|
||||
return output;
|
||||
}
|
||||
|
||||
test("client cancellation and deadlines stop upstream Den proxy work with stable sanitized errors", async ({ evidence }) => {
|
||||
runDenWebBunTest("app/api/_lib/upstream-proxy-lifecycle.test.mjs", 5);
|
||||
|
||||
evidence.recordAssertionEvidence(
|
||||
"Abandoned and timed-out proxy requests stop upstream work with sanitized responses",
|
||||
"Client aborts propagated to the upstream fetch signal, deadline expiry returned a stable 504 upstream_timeout and connection failures a 502 upstream_unreachable without leaking internal origins or socket details, successful bodies streamed without buffering, and abort listeners plus timers were released after completion.",
|
||||
true,
|
||||
);
|
||||
|
||||
runDenWebBunTest("app/api/_lib/upstream-proxy.test.mjs", 19);
|
||||
|
||||
evidence.recordAssertionEvidence(
|
||||
"Existing proxy behavior is unchanged",
|
||||
"The full pre-existing upstream proxy suite passed against a real loopback upstream, including CORS reflection, cookie scoping, header sanitization, compressed bodies, and forwarded-header handling.",
|
||||
true,
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user