数字我 Digital Me:全量入库(大文件走 Git LFS)
nginx serve /uploads direct (audio speed) / patch-nginx (push) Failing after 1m34s
nginx serve /uploads direct (audio speed) / patch-nginx (push) Failing after 1m34s
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
// 《她传》—— 扮演历史著名女性、走她真实一生 —— 框架单测。跑:node --test test/nvxing.test.js
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { listNvxing, getNvxing } from '../src/nvxing.js';
|
||||
|
||||
test('★ 名录:每位带 name/title/steps', () => {
|
||||
const women = listNvxing();
|
||||
assert.ok(women.length >= 1, '至少一位');
|
||||
assert.ok(women.every((w) => w.name && w.title && w.steps > 0), '每位有名/名号/关口数');
|
||||
assert.ok(women.some((w) => w.id === 'wuzetian'), '含武则天');
|
||||
});
|
||||
|
||||
test('★★ 武则天一生弧:每关都有处境 + 两选 + 她真实作为 + 双证 cite', () => {
|
||||
const w = getNvxing('wuzetian');
|
||||
assert.ok(w && Array.isArray(w.arc) && w.arc.length >= 3, '至少 3 关');
|
||||
assert.ok(w.from, '有起点');
|
||||
for (const g of w.arc) {
|
||||
assert.ok(g.situ && g.prompt, `${g.guan} 要有处境+设问`);
|
||||
assert.equal(g.options.length, 2, `${g.guan} 两选一`);
|
||||
assert.ok(g.real, `${g.guan} 要有她真实怎么走`);
|
||||
assert.ok(g.cite && /《.+》/.test(g.cite), `${g.guan} 要有可查双证 cite`);
|
||||
}
|
||||
});
|
||||
|
||||
test('★ 未知女性 → null', () => {
|
||||
assert.equal(getNvxing('nobody'), null);
|
||||
assert.equal(getNvxing(''), null);
|
||||
});
|
||||
Reference in New Issue
Block a user