test: split cli tests from source tree

This commit is contained in:
Andrey Avtomonov 2026-05-25 13:17:46 +02:00
parent 7d79d4e38e
commit 4619217804
496 changed files with 2582 additions and 952 deletions

View file

@ -1,26 +0,0 @@
import { describe, expect, it } from 'vitest';
import { defaultLaneCandidatePoolLimit, normalizeSearchQuery } from './query.js';
describe('search query helpers', () => {
it('normalizes punctuation and duplicate terms into stable lowercase tokens', () => {
expect(normalizeSearchQuery(' Gross-Revenue, gross_revenue! Paid orders ')).toEqual({
raw: ' Gross-Revenue, gross_revenue! Paid orders ',
normalized: 'gross revenue gross_revenue paid orders',
terms: ['gross', 'revenue', 'gross_revenue', 'paid', 'orders'],
});
});
it('returns an empty normalized query for punctuation-only input', () => {
expect(normalizeSearchQuery('--- ///')).toEqual({
raw: '--- ///',
normalized: '',
terms: [],
});
});
it('sizes per-lane candidate pools before final limiting', () => {
expect(defaultLaneCandidatePoolLimit(1)).toBe(25);
expect(defaultLaneCandidatePoolLimit(8)).toBe(25);
expect(defaultLaneCandidatePoolLimit(10)).toBe(30);
});
});