feature: First push to git

This commit is contained in:
Keith Solomon
2026-05-16 14:02:49 -05:00
commit 265f69d95a
46 changed files with 11551 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
import { mkdtemp, rm } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
import { StateStore } from '../src/state/state.js';
let dir = '';
beforeEach(async () => {
dir = await mkdtemp(join(tmpdir(), 'nlc-'));
});
afterEach(async () => {
await rm(dir, { force: true, recursive: true });
});
describe('state persistence', () => {
it('tracks processed messages incrementally', async () => {
const store = new StateStore(join(dir, 'state.json'));
expect(await store.isProcessed('msg-1')).toBe(false);
await store.markProcessed('msg-1');
expect(await store.isProcessed('msg-1')).toBe(true);
});
});