Files
blb-throne-of-the-bone-king/__tests__/toolkitDataPlaceholders.test.js
T

55 lines
1.3 KiB
JavaScript
Raw Normal View History

const { existsSync, readFileSync } = require('node:fs');
2026-06-16 11:19:24 -05:00
const path = require('node:path');
const toolkitDataFiles = [
2026-06-16 11:19:24 -05:00
'audio.json',
'changelog.json',
2026-06-16 11:19:24 -05:00
'credits.json',
'endings.json',
'factions.json',
'flags.json',
'images.json',
'legal.json',
2026-06-16 11:19:24 -05:00
'lore.json',
'map.json',
'opening.json',
'petitioners.json',
'references.json',
'resources.json',
'rulings.json',
'seed.json',
'story.json',
];
describe('toolkit data files', () => {
it('keeps app content JSON consolidated under toolkit data', () => {
for (const fileName of ['changelog.json', 'credits.json', 'legal.json']) {
expect(
existsSync(path.join(process.cwd(), 'src', 'data', 'toolkit', fileName)),
).toBe(true);
expect(existsSync(path.join(process.cwd(), 'src', 'data', fileName))).toBe(
false,
);
}
});
it('provides starter JSON content for every toolkit data resource', () => {
for (const fileName of toolkitDataFiles) {
2026-06-16 11:19:24 -05:00
const filePath = path.join(
process.cwd(),
'src',
'data',
'toolkit',
fileName,
);
const content = JSON.parse(readFileSync(filePath, 'utf8'));
if (Array.isArray(content)) {
expect(content.length).toBeGreaterThan(0);
} else {
expect(Object.keys(content).length).toBeGreaterThan(0);
}
2026-06-16 11:19:24 -05:00
}
});
});