mirror of
https://github.com/smogon/sprites.git
synced 2026-08-18 15:30:37 -05:00
26 lines
660 B
TypeScript
26 lines
660 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', () => {
|
|
const 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/);
|
|
});
|