Files
sprites/tools/build/test/config.test.ts
Christopher Monsanto 3ec1abad12 Write let instead of const
Per the house rule, const survives only where TypeScript hangs
behavior off the spelling: the <const T> type parameter in rule()
and the as const option tables.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-21 01:13:14 -04:00

26 lines
658 B
TypeScript

import assert from 'node:assert/strict';
import {test} from 'node:test';
import {parseConfig} from '../config.ts';
test('parseConfig parses values with spaces and equals', () => {
let cfg = parseConfig([
'# comment',
'',
'MODELS_OPTIPNG=-o7',
'MINISPRITE_ADVPNG = -z4 -i100 ',
'WEIRD=a=b',
'#DISABLED=x',
].join('\n'));
assert.deepEqual([...cfg], [
['MODELS_OPTIPNG', '-o7'],
['MINISPRITE_ADVPNG', '-z4 -i100'],
['WEIRD', 'a=b'],
]);
});
test('parseConfig rejects malformed lines', () => {
assert.throws(() => parseConfig('NOVALUE'), /Invalid config line/);
});