Fix import ordering and formatting in test files to pass biome checks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { readFile, access } from "node:fs/promises";
|
||||
import { access, readFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const CLI_DIR = join(import.meta.dirname, "..");
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
describe("uconn Type Safety Tests", () => {
|
||||
it("should have proper type annotations for all variables", () => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
||||
import { spawn } from "node:child_process";
|
||||
import { readFile, readdir, rm } from "node:fs/promises";
|
||||
import { homedir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
const RECORDS_DIR = join(homedir(), ".uwf-dashboard/records");
|
||||
const UREC_PATH = join(import.meta.dirname, "../dist/urec.js");
|
||||
@@ -55,21 +55,23 @@ describe("urec Functional Behavior Tests", () => {
|
||||
});
|
||||
|
||||
it("should execute basic command and create record", async () => {
|
||||
const result = await new Promise<{ stdout: string; stderr: string; exitCode: number | null }>((resolve) => {
|
||||
const proc = spawn("node", [UREC_PATH, "echo", "test"]);
|
||||
let stdout = "";
|
||||
let stderr = "";
|
||||
const result = await new Promise<{ stdout: string; stderr: string; exitCode: number | null }>(
|
||||
(resolve) => {
|
||||
const proc = spawn("node", [UREC_PATH, "echo", "test"]);
|
||||
let stdout = "";
|
||||
let stderr = "";
|
||||
|
||||
proc.stdout?.on("data", (d) => {
|
||||
stdout += d.toString();
|
||||
});
|
||||
proc.stderr?.on("data", (d) => {
|
||||
stderr += d.toString();
|
||||
});
|
||||
proc.on("close", (exitCode) => {
|
||||
resolve({ stdout, stderr, exitCode });
|
||||
});
|
||||
});
|
||||
proc.stdout?.on("data", (d) => {
|
||||
stdout += d.toString();
|
||||
});
|
||||
proc.stderr?.on("data", (d) => {
|
||||
stderr += d.toString();
|
||||
});
|
||||
proc.on("close", (exitCode) => {
|
||||
resolve({ stdout, stderr, exitCode });
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
expect(result.exitCode).toBe(0);
|
||||
expect(result.stdout).toContain("test");
|
||||
@@ -97,21 +99,23 @@ describe("urec Functional Behavior Tests", () => {
|
||||
}, 10000);
|
||||
|
||||
it("should capture stderr", async () => {
|
||||
const result = await new Promise<{ stdout: string; stderr: string; exitCode: number | null }>((resolve) => {
|
||||
const proc = spawn("node", [UREC_PATH, "node", "-e", "console.error('error message')"]);
|
||||
let stdout = "";
|
||||
let stderr = "";
|
||||
const result = await new Promise<{ stdout: string; stderr: string; exitCode: number | null }>(
|
||||
(resolve) => {
|
||||
const proc = spawn("node", [UREC_PATH, "node", "-e", "console.error('error message')"]);
|
||||
let stdout = "";
|
||||
let stderr = "";
|
||||
|
||||
proc.stdout?.on("data", (d) => {
|
||||
stdout += d.toString();
|
||||
});
|
||||
proc.stderr?.on("data", (d) => {
|
||||
stderr += d.toString();
|
||||
});
|
||||
proc.on("close", (exitCode) => {
|
||||
resolve({ stdout, stderr, exitCode });
|
||||
});
|
||||
});
|
||||
proc.stdout?.on("data", (d) => {
|
||||
stdout += d.toString();
|
||||
});
|
||||
proc.stderr?.on("data", (d) => {
|
||||
stderr += d.toString();
|
||||
});
|
||||
proc.on("close", (exitCode) => {
|
||||
resolve({ stdout, stderr, exitCode });
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
expect(result.stderr).toContain("error message");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user