Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion test/safe-teardown.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import assert from "node:assert/strict"
import { Buffer } from "node:buffer"
import http from "node:http"
import test from "node:test"
import test, { beforeEach } from "node:test"

import { createProxyFetchHandler, sweepStaleProxySessions } from "../index.js"

// Keep the suite hermetic: OPENCODE_LLM_PROXY_* variables from the developer's
// shell or CI (e.g. a token, host or port) must not change outcomes. Tests that
// need a specific value set it inside the test body, after this hook has run.
beforeEach(() => {
for (const name of Object.keys(process.env)) {
if (name.startsWith("OPENCODE_LLM_PROXY_")) delete process.env[name]
}
})

const TOKENS = { input: 2, output: 1, reasoning: 0, cache: { read: 0, write: 0 } }

function createMockClient({ promptMode = "hang", streamEvents = null } = {}) {
Expand Down
Loading