test(whatsapp): accept native Windows auth paths

This commit is contained in:
Vincent Koc
2026-05-04 06:48:07 -07:00
parent 15b9966781
commit 3d3b0dad77
2 changed files with 4 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
import { rmSync } from "node:fs";
import fs from "node:fs/promises";
import path from "node:path";
import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
import { afterAll, afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { loginWeb } from "./login.js";
@@ -158,7 +159,7 @@ describe("loginWeb coverage", () => {
/cache cleared/i,
);
expect(runtime.error).toHaveBeenCalledWith(expect.stringContaining("session is logged out"));
expect(rmMock).toHaveBeenCalledWith(testState.authDir, {
expect(rmMock).toHaveBeenCalledWith(path.resolve(testState.authDir), {
recursive: true,
force: true,
});

View File

@@ -31,8 +31,8 @@ async function emitCredsUpdate(authDir?: string) {
}
function createTempAuthDir(prefix: string) {
return fsSync.mkdtempSync(
path.join((process.env.TMPDIR ?? "/tmp").replace(/\/+$/, ""), `${prefix}-`),
return path.resolve(
fsSync.mkdtempSync(path.join((process.env.TMPDIR ?? "/tmp").replace(/\/+$/, ""), `${prefix}-`)),
);
}