Build Atelier 64 chess training app

This commit is contained in:
Michael committed 2026-07-20 15:18:52 +02:00
commit 3dd0aa9a09
15 files changed
+2574

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { normalizeOllamaUrl, parseInfo } from './engine.js';
test('parse une ligne MultiPV Stockfish', () => {
assert.deepEqual(parseInfo('info depth 16 multipv 2 score cp -34 nodes 4 pv e2e4 e7e5'), {
depth: 16, multipv: 2, score: { type: 'cp', value: -34 }, pv: ['e2e4', 'e7e5'],
});
});
test('normalise URL Ollama', () => {
assert.equal(normalizeOllamaUrl('http://192.168.1.3:11434/'), 'http://192.168.1.3:11434');
assert.throws(() => normalizeOllamaUrl('file:///etc/passwd'));
});