|
2 | 2 | test, |
3 | 3 | afterEach, |
4 | 4 | describe, |
| 5 | + it, |
5 | 6 | setDefaultTimeout, |
6 | 7 | beforeAll, |
7 | 8 | expect, |
@@ -253,22 +254,41 @@ describe("goose", async () => { |
253 | 254 | expect(prompt.stderr).toContain("No such file or directory"); |
254 | 255 | }); |
255 | 256 |
|
256 | | - test("subdomain-false", async () => { |
257 | | - const { id } = await setup({ |
258 | | - agentapiMockScript: await loadTestFile( |
259 | | - import.meta.dir, |
260 | | - "agentapi-mock-print-args.js", |
261 | | - ), |
262 | | - moduleVariables: { |
263 | | - subdomain: "false", |
264 | | - }, |
| 257 | + describe("subdomain", async () => { |
| 258 | + it("sets AGENTAPI_CHAT_BASE_PATH when false", async () => { |
| 259 | + const { id } = await setup({ |
| 260 | + agentapiMockScript: await loadTestFile( |
| 261 | + import.meta.dir, |
| 262 | + "agentapi-mock-print-args.js", |
| 263 | + ), |
| 264 | + moduleVariables: { |
| 265 | + subdomain: "false", |
| 266 | + }, |
| 267 | + }); |
| 268 | + |
| 269 | + await execModuleScript(id); |
| 270 | + |
| 271 | + const agentapiMockOutput = await readFileContainer(id, agentapiStartLog); |
| 272 | + expect(agentapiMockOutput).toContain( |
| 273 | + "AGENTAPI_CHAT_BASE_PATH=/@default/default.foo/apps/goose/chat", |
| 274 | + ); |
265 | 275 | }); |
266 | 276 |
|
267 | | - await execModuleScript(id); |
| 277 | + it("does not set AGENTAPI_CHAT_BASE_PATH when true", async () => { |
| 278 | + const { id } = await setup({ |
| 279 | + agentapiMockScript: await loadTestFile( |
| 280 | + import.meta.dir, |
| 281 | + "agentapi-mock-print-args.js", |
| 282 | + ), |
| 283 | + moduleVariables: { |
| 284 | + subdomain: "true", |
| 285 | + }, |
| 286 | + }); |
268 | 287 |
|
269 | | - const agentapiMockOutput = await readFileContainer(id, agentapiStartLog); |
270 | | - expect(agentapiMockOutput).toContain( |
271 | | - "AGENTAPI_CHAT_BASE_PATH=/@default/default.foo/apps/goose/chat", |
272 | | - ); |
| 288 | + await execModuleScript(id); |
| 289 | + |
| 290 | + const agentapiMockOutput = await readFileContainer(id, agentapiStartLog); |
| 291 | + expect(agentapiMockOutput).toMatch(/AGENTAPI_CHAT_BASE_PATH=$/m); |
| 292 | + }); |
273 | 293 | }); |
274 | 294 | }); |
0 commit comments