mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 02:58:26 +00:00
fix(media): strip MEDIA: prefix in loadWebMediaInternal (#13107)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 9d95e6af5a
Co-authored-by: mcaxtr <7562095+mcaxtr@users.noreply.github.com>
Co-authored-by: steipete <58493+steipete@users.noreply.github.com>
Reviewed-by: @steipete
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import { beforeEach, type MockInstance, vi } from "vitest";
|
||||
import { beforeEach, vi } from "vitest";
|
||||
|
||||
type NotificationHandler = (msg: { method: string; params?: unknown }) => void;
|
||||
|
||||
// Avoid exporting vitest mock types (TS2742 under pnpm + d.ts emit).
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
type AnyMock = any;
|
||||
|
||||
const state = vi.hoisted(() => ({
|
||||
requestMock: vi.fn(),
|
||||
stopMock: vi.fn(),
|
||||
@@ -15,39 +19,39 @@ const state = vi.hoisted(() => ({
|
||||
closeResolve: undefined as (() => void) | undefined,
|
||||
}));
|
||||
|
||||
export function getRequestMock(): MockInstance {
|
||||
export function getRequestMock(): AnyMock {
|
||||
return state.requestMock;
|
||||
}
|
||||
|
||||
export function getStopMock(): MockInstance {
|
||||
export function getStopMock(): AnyMock {
|
||||
return state.stopMock;
|
||||
}
|
||||
|
||||
export function getSendMock(): MockInstance {
|
||||
export function getSendMock(): AnyMock {
|
||||
return state.sendMock;
|
||||
}
|
||||
|
||||
export function getReplyMock(): MockInstance {
|
||||
export function getReplyMock(): AnyMock {
|
||||
return state.replyMock;
|
||||
}
|
||||
|
||||
export function getUpdateLastRouteMock(): MockInstance {
|
||||
export function getUpdateLastRouteMock(): AnyMock {
|
||||
return state.updateLastRouteMock;
|
||||
}
|
||||
|
||||
export function getReadAllowFromStoreMock(): MockInstance {
|
||||
export function getReadAllowFromStoreMock(): AnyMock {
|
||||
return state.readAllowFromStoreMock;
|
||||
}
|
||||
|
||||
export function getUpsertPairingRequestMock(): MockInstance {
|
||||
export function getUpsertPairingRequestMock(): AnyMock {
|
||||
return state.upsertPairingRequestMock;
|
||||
}
|
||||
|
||||
export function getNotificationHandler() {
|
||||
export function getNotificationHandler(): NotificationHandler | undefined {
|
||||
return state.notificationHandler;
|
||||
}
|
||||
|
||||
export function getCloseResolve() {
|
||||
export function getCloseResolve(): (() => void) | undefined {
|
||||
return state.closeResolve;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user