mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 20:20:21 +00:00
Tests: fix boundary and late-run drift
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||
import {
|
||||
clearMemoryEmbeddingProviders,
|
||||
getMemoryEmbeddingProvider,
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
} from "./memory-embedding-providers.js";
|
||||
|
||||
const MEMORY_EMBEDDING_PROVIDERS_KEY = Symbol.for("openclaw.memoryEmbeddingProviders");
|
||||
const INITIAL_REGISTERED_MEMORY_EMBEDDING_PROVIDERS = listRegisteredMemoryEmbeddingProviders();
|
||||
|
||||
function createAdapter(id: string): MemoryEmbeddingProviderAdapter {
|
||||
return {
|
||||
@@ -92,10 +93,14 @@ function expectRegisteredProviderSnapshotCase(params: {
|
||||
});
|
||||
}
|
||||
|
||||
afterEach(() => {
|
||||
beforeEach(() => {
|
||||
clearMemoryEmbeddingProviders();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
restoreRegisteredMemoryEmbeddingProviders(INITIAL_REGISTERED_MEMORY_EMBEDDING_PROVIDERS);
|
||||
});
|
||||
|
||||
describe("memory embedding provider registry", () => {
|
||||
it("registers and lists adapters in insertion order", () => {
|
||||
const alpha = createAdapter("alpha");
|
||||
|
||||
Reference in New Issue
Block a user