Files
gmtool/tests/npc/packs.test.js
T
tevansandClaude Opus 4.8 03ce5e1606 feat: NPC noir genre table pack + genre registry
Implements Slice 2 Task 1: Noir/Blade Runner genre pack with curated
string tables (names, looks, manners, wants, secrets, voices) and a
registry mapping id->pack for use by offline NPC generator.

Tests: 2/2 pass (noir structure + registry resolution).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 15:10:35 +01:00

24 lines
957 B
JavaScript

import { describe, it, expect } from 'vitest';
import { noir } from '../../src/npc/packs/noir.js';
import { getGenrePack, listGenrePacks } from '../../src/npc/packs/index.js';
const FIELDS = ['firstNames', 'surnames', 'looks', 'manners', 'wants', 'secrets', 'voices'];
describe('noir genre pack', () => {
it('has an id, label, and all non-empty tables', () => {
expect(noir.id).toBe('noir');
expect(noir.label).toMatch(/noir/i);
for (const f of FIELDS) {
expect(Array.isArray(noir.tables[f]), `${f} is array`).toBe(true);
expect(noir.tables[f].length, `${f} non-empty`).toBeGreaterThanOrEqual(6);
expect(noir.tables[f].every((x) => typeof x === 'string' && x.length > 0)).toBe(true);
}
});
it('is resolvable from the registry', () => {
expect(getGenrePack('noir')).toBe(noir);
expect(getGenrePack('missing')).toBe(null);
expect(listGenrePacks()).toEqual([{ id: 'noir', label: noir.label }]);
});
});