mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 12:30:22 +00:00
test: fix ci env-sensitive assertions
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
createDirectoryTestRuntime,
|
||||
expectDirectorySurface,
|
||||
@@ -19,6 +19,10 @@ describe("msteams directory", () => {
|
||||
const runtimeEnv = createDirectoryTestRuntime() as RuntimeEnv;
|
||||
const directorySelf = requireDirectorySelf(msteamsPlugin.directory);
|
||||
|
||||
afterEach(() => {
|
||||
vi.unstubAllEnvs();
|
||||
});
|
||||
|
||||
describe("self()", () => {
|
||||
it("returns bot identity when credentials are configured", async () => {
|
||||
const cfg = {
|
||||
@@ -36,6 +40,9 @@ describe("msteams directory", () => {
|
||||
});
|
||||
|
||||
it("returns null when credentials are not configured", async () => {
|
||||
vi.stubEnv("MSTEAMS_APP_ID", "");
|
||||
vi.stubEnv("MSTEAMS_APP_PASSWORD", "");
|
||||
vi.stubEnv("MSTEAMS_TENANT_ID", "");
|
||||
const cfg = { channels: {} } as unknown as OpenClawConfig;
|
||||
const result = await directorySelf({ cfg, runtime: runtimeEnv });
|
||||
expect(result).toBeNull();
|
||||
|
||||
@@ -12,6 +12,6 @@ describe("SynologyChatChannelConfigSchema", () => {
|
||||
});
|
||||
|
||||
it("keeps the schema open for plugin-specific passthrough fields", () => {
|
||||
expect(SynologyChatChannelConfigSchema.schema.additionalProperties).toBe(true);
|
||||
expect([true, {}]).toContainEqual(SynologyChatChannelConfigSchema.schema.additionalProperties);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user