Files
blb-throne-of-the-bone-king/__tests__/toolkitDataPlaceholders.test.js
T
jacob-mathison 47567589e4
ci/woodpecker/push/woodpecker Pipeline was successful
Lint and Build Checks / Lint, Test, and Build (push) Failing after 368h6m42s
feat(toolkit): add structured media authoring
2026-06-24 11:30:26 -05:00

55 lines
1.3 KiB
JavaScript

const { existsSync, readFileSync } = require('node:fs');
const path = require('node:path');
const toolkitDataFiles = [
'audio.json',
'changelog.json',
'credits.json',
'endings.json',
'factions.json',
'flags.json',
'images.json',
'legal.json',
'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) {
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);
}
}
});
});