|
3 | 3 | import { describe, it, expect, vi, beforeEach } from "vitest" |
4 | 4 | import * as nodePath from "path" |
5 | 5 | import * as nodeFs from "fs" |
| 6 | +import type { PathLike } from "fs" |
6 | 7 | import * as vscode from "vscode" |
7 | 8 | import { openFile } from "../../../integrations/misc/open-file" |
8 | 9 | import { webviewMessageHandler } from "../webviewMessageHandler" |
@@ -120,7 +121,7 @@ describe("webviewMessageHandler - openFile markdown workspace containment", () = |
120 | 121 | realWorld.symlinks.clear() |
121 | 122 | realWorld.existing.add(WORKSPACE_ROOT) |
122 | 123 | realWorld.existing.add(MOCK_CWD) |
123 | | - vi.spyOn(nodeFs.promises, "realpath").mockImplementation(async (p: string | URL) => { |
| 124 | + vi.spyOn(nodeFs.promises, "realpath").mockImplementation(async (p: PathLike) => { |
124 | 125 | const key = String(p) |
125 | 126 | const symlink = realWorld.symlinks.get(key) |
126 | 127 | if (symlink) { |
@@ -377,7 +378,7 @@ describe("utils/pathUtils containment helpers", () => { |
377 | 378 | realWorld.symlinks.clear() |
378 | 379 | realWorld.existing.add(WORKSPACE_ROOT) |
379 | 380 | realWorld.existing.add(MOCK_CWD) |
380 | | - vi.spyOn(nodeFs.promises, "realpath").mockImplementation(async (p: string | URL) => { |
| 381 | + vi.spyOn(nodeFs.promises, "realpath").mockImplementation(async (p: PathLike) => { |
381 | 382 | const key = String(p) |
382 | 383 | const symlink = realWorld.symlinks.get(key) |
383 | 384 | if (symlink) { |
@@ -458,7 +459,7 @@ describe("utils/pathUtils containment helpers", () => { |
458 | 459 | realWorld.existing.add(nodePath.join(MOCK_CWD, "x.ts")) |
459 | 460 | const err = new Error("EACCES: permission denied") |
460 | 461 | ;(err as NodeJS.ErrnoException).code = "EACCES" |
461 | | - vi.spyOn(nodeFs.promises, "realpath").mockImplementation(async (p: string | URL) => { |
| 462 | + vi.spyOn(nodeFs.promises, "realpath").mockImplementation(async (p: PathLike) => { |
462 | 463 | const key = String(p) |
463 | 464 | if (key === WORKSPACE_ROOT) { |
464 | 465 | throw err |
|
0 commit comments