Files
dify/sdks/nodejs-client/src/client/workspace.test.js
yyh 4d48791f3c refactor: nodejs sdk (#30036)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-23 23:24:38 +08:00

22 lines
609 B
JavaScript

import { beforeEach, describe, expect, it, vi } from "vitest";
import { WorkspaceClient } from "./workspace";
import { createHttpClientWithSpies } from "../../tests/test-utils";
describe("WorkspaceClient", () => {
beforeEach(() => {
vi.restoreAllMocks();
});
it("gets models by type", async () => {
const { client, request } = createHttpClientWithSpies();
const workspace = new WorkspaceClient(client);
await workspace.getModelsByType("llm");
expect(request).toHaveBeenCalledWith({
method: "GET",
path: "/workspaces/current/models/model-types/llm",
});
});
});