25 lines
801 B
TypeScript
25 lines
801 B
TypeScript
import { describe, it } from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { parseExpand } from '../src/services/resolution.service.js';
|
|
|
|
describe('parseExpand', () => {
|
|
it('returns defaults when empty', () => {
|
|
const s = parseExpand(undefined);
|
|
assert.ok(s.has('registry'));
|
|
assert.ok(s.has('dht'));
|
|
assert.ok(!s.has('probes'));
|
|
});
|
|
|
|
it('parses comma list, lowercases, trims', () => {
|
|
const s = parseExpand(' Geo , PROBES ');
|
|
assert.ok(s.has('geo'));
|
|
assert.ok(s.has('probes'));
|
|
assert.equal(s.size, 2);
|
|
});
|
|
|
|
it('expands "all" to the full set', () => {
|
|
const s = parseExpand('all');
|
|
for (const k of ['registry', 'bgp', 'dns', 'geo', 'providers', 'probes', 'raw', 'dht', 'banners'])
|
|
assert.ok(s.has(k), `missing ${k}`);
|
|
});
|
|
});
|