Files
image/node-hook/test/inventory.test.mjs
T

22 lines
688 B
JavaScript

import assert from 'node:assert/strict';
import test from 'node:test';
import { buildLegacyInventory } from '../src/inventory.mjs';
test('legacy inventory preserves dirname to stem to basename shape', () => {
assert.deepEqual(buildLegacyInventory([
'game/back.jpg',
'icons/1047.jpg',
'icons/장수/유표.jpg',
'icons/장수/유표1.png',
]), {
'.': { '1047': '1047.jpg' },
'장수': { '유표': '유표.jpg', '유표1': '유표1.png' },
});
});
test('legacy duplicate stems retain the last Git path for PHP compatibility', () => {
assert.deepEqual(buildLegacyInventory(['icons/a/same.jpg', 'icons/a/same.png']), {
a: { same: 'same.png' },
});
});