import { test } from 'node:test'; import assert from 'node:assert/strict'; import { formatLabel, formatStatus, formatTimeline, formatBudget } from './format.js'; test('formatLabel replaces _ and - and title-cases', () => { assert.equal(formatLabel('contract_pending'), 'Contract Pending'); assert.equal(formatLabel('in-progress'), 'In Progress'); assert.equal(formatLabel(''), ''); assert.equal(formatLabel(null), ''); }); test('formatStatus is formatLabel', () => { assert.equal(formatStatus('matched'), 'Matched'); }); test('formatTimeline maps known slugs, falls back otherwise', () => { assert.equal(formatTimeline('6_to_12_months'), '6–12 months'); assert.equal(formatTimeline('flexible'), 'Flexible'); assert.equal(formatTimeline('something_else'), 'Something Else'); }); test('formatBudget maps known ranges', () => { assert.equal(formatBudget('25k-50k'), '$25,000 – $50,000'); assert.equal(formatBudget('100k-plus'), '$100,000+'); assert.equal(formatBudget(''), ''); });