Skip to content

armgit / fli

Public Imported from GitHub
0

Google Flights MCP, CLI and Python Library

fix(fli-js): restore unset FLI_TIMEOUT with delete so Bun 1.4 tests pass (#239)

Punit Arani56e7df88913f
diff --git a/fli-js/tests/search/client.test.ts b/fli-js/tests/search/client.test.ts
index f043655..ed21278 100644
--- a/fli-js/tests/search/client.test.ts
+++ b/fli-js/tests/search/client.test.ts
@@ -32,7 +32,13 @@ describe("Client", () => {
originalEnv = process.env.FLI_TIMEOUT;
});
afterEach(() => {
- process.env.FLI_TIMEOUT = originalEnv;
+ // Assigning `undefined` to process.env stores the string "undefined"
+ // (Node semantics, adopted by Bun 1.4), which poisons later tests.
+ if (originalEnv === undefined) {
+ delete process.env.FLI_TIMEOUT;
+ } else {
+ process.env.FLI_TIMEOUT = originalEnv;
+ }
});
test("POST with body sends the expected request", async () => {