landvex: Fixar och tester klara för alla komponenter

- Datafabrik: Dockerfile fix, agentorkestrering fungerar
- Vision: Identify-modell, FAISS, OCR alla testade
- API: Alla 7 integrationstester passerade
- Upplösare: Entitetsupplösning verifierad
This commit is contained in:
Bernt
2026-07-05 06:41:32 +00:00
parent f4f853d94b
commit aee0f09db8
19583 changed files with 1450867 additions and 1153 deletions
+52
View File
@@ -0,0 +1,52 @@
import AsyncTestUtil from 'async-test-util';
import * as assert from 'assert';
import {
ObliviousSet
} from '../src/index';
describe('unit.test.js', () => {
it('create, add, has, get, clear', () => {
const set = new ObliviousSet(100);
set.add('foobar');
const has = set.has('foobar');
assert.ok(has);
set.clear();
const hasAfter = set.has('foobar');
assert.strictEqual(false, hasAfter);
});
it('.removeTooOldValues() should clear the old values when a new one is given', async () => {
const set = new ObliviousSet(100);
set.add('foobar');
assert.ok(set.has('foobar'));
await AsyncTestUtil.wait(200);
set.add('foobar2');
await AsyncTestUtil.wait(100);
const has = set.has('foobar');
assert.strictEqual(false, has);
});
it('.removeTooOldValues() should NOT clear to young values when a new one is given', async () => {
const set = new ObliviousSet(500);
set.add('foobar');
assert.ok(set.has('foobar'));
await AsyncTestUtil.wait(50);
set.add('foobar2');
assert.ok(set.has('foobar'));
});
it('should clear the value after its ttl', async () => {
const set = new ObliviousSet(100);
set.add('foobar');
await AsyncTestUtil.wait(200);
set.add('foobar2');
await AsyncTestUtil.wait(100);
const has = set.has('foobar');
assert.strictEqual(false, has);
});
});