|
1 | | -import { resolve } from "node:path"; |
| 1 | +import { join, resolve } from "node:path"; |
2 | 2 |
|
3 | 3 | import { readConfig } from "@allurereport/core"; |
4 | 4 | import { |
@@ -359,7 +359,7 @@ describe("agent command", () => { |
359 | 359 | }), |
360 | 360 | ); |
361 | 361 | expect(logMock).toHaveBeenNthCalledWith(1, "agent output: /tmp/allure-agent-123"); |
362 | | - expect(logMock).toHaveBeenNthCalledWith(2, "agent index: /tmp/allure-agent-123/index.md"); |
| 362 | + expect(logMock).toHaveBeenNthCalledWith(2, `agent index: ${join("/tmp/allure-agent-123", "index.md")}`); |
363 | 363 | expect(logMock).toHaveBeenNthCalledWith(3, "npm test"); |
364 | 364 | expect(logMock.mock.invocationCallOrder[0]).toBeLessThan((executeAllureRun as Mock).mock.invocationCallOrder[0]); |
365 | 365 | expect(writeLatestAgentState).toHaveBeenNthCalledWith( |
@@ -437,7 +437,7 @@ describe("agent command", () => { |
437 | 437 | }, |
438 | 438 | }); |
439 | 439 | expect(consoleModule.log).toHaveBeenCalledWith(`agent output: ${resolvedOutput}`); |
440 | | - expect(consoleModule.log).toHaveBeenCalledWith(`agent index: ${resolvedOutput}/index.md`); |
| 440 | + expect(consoleModule.log).toHaveBeenCalledWith(`agent index: ${join(resolvedOutput, "index.md")}`); |
441 | 441 | expect(consoleModule.log).toHaveBeenCalledWith(`agent expectations: ${resolvedExpectations}`); |
442 | 442 | }); |
443 | 443 |
|
@@ -557,7 +557,7 @@ describe("agent command", () => { |
557 | 557 | expect(readConfig).not.toHaveBeenCalled(); |
558 | 558 | expect(executeAllureRun).not.toHaveBeenCalled(); |
559 | 559 | expect(consoleModule.log).toHaveBeenCalledWith(`agent output: ${outputDir}`); |
560 | | - expect(consoleModule.log).toHaveBeenCalledWith(`agent index: ${outputDir}/index.md`); |
| 560 | + expect(consoleModule.log).toHaveBeenCalledWith(`agent index: ${join(outputDir, "index.md")}`); |
561 | 561 | expect(consoleModule.error).toHaveBeenCalledWith( |
562 | 562 | 'Invalid --expect-label "module". Expected the form name=value, for example module=cli', |
563 | 563 | ); |
@@ -589,7 +589,7 @@ describe("agent command", () => { |
589 | 589 | expect(readConfig).not.toHaveBeenCalled(); |
590 | 590 | expect(executeAllureRun).not.toHaveBeenCalled(); |
591 | 591 | expect(consoleModule.log).toHaveBeenCalledWith(`agent output: ${outputDir}`); |
592 | | - expect(consoleModule.log).toHaveBeenCalledWith(`agent index: ${outputDir}/index.md`); |
| 592 | + expect(consoleModule.log).toHaveBeenCalledWith(`agent index: ${join(outputDir, "index.md")}`); |
593 | 593 | expect(consoleModule.error).toHaveBeenCalledWith( |
594 | 594 | "Could not load expectations from /cwd/expected.yaml: Expected a YAML or JSON object", |
595 | 595 | ); |
|
0 commit comments