Skip to content

Commit

Permalink
update file system writer test
Browse files Browse the repository at this point in the history
  • Loading branch information
epszaw committed May 24, 2024
1 parent b7d841a commit 0f87498
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { randomUUID } from "crypto";
import { existsSync, mkdtempSync, readFileSync, readdirSync, writeFileSync } from "fs";
import * as os from "os";
import path from "path";
import { randomUUID } from "node:crypto";
import { existsSync, mkdtempSync, readFileSync, readdirSync, writeFileSync, rmSync } from "node:fs";
import * as os from "node:os";
import path from "node:path";
import { describe, expect, it } from "vitest";
import { AllureNodeReporterRuntime, Config, ContentType, FileSystemAllureWriter } from "../../src/sdk/node/index.js";

Expand Down Expand Up @@ -39,7 +39,7 @@ describe("FileSystemAllureWriter", () => {
expect(actualContent.toString("utf8")).toBe(data);
});

it("creates allure-report nested path every time writer write something", () => {
it("creates allure-report nested path every time writer write something", async () => {
const tmpReportPath = path.join(os.tmpdir(), `./allure-testing-dir/${randomUUID()}`);
const config: Config = {
writer: new FileSystemAllureWriter({
Expand All @@ -48,6 +48,10 @@ describe("FileSystemAllureWriter", () => {
};
const runtime = new AllureNodeReporterRuntime(config);

runtime.startTest({});
runtime.stopTest();
runtime.writeTest();
rmSync(tmpReportPath, { recursive: true });
runtime.startTest({});
runtime.stopTest();
runtime.writeTest();
Expand Down

0 comments on commit 0f87498

Please sign in to comment.