数字我 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,42 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { getSong, hasSong, families, listFlat, listGroups, songCount, songForBase } from '../src/services/musicLibrary.js';
|
||||
|
||||
test('曲库深链可按历史锚点精确定位,且不暴露制作配方', () => {
|
||||
const base = 'shishi:chuanshi';
|
||||
const result = listGroups({ family: '史诗原声', base });
|
||||
|
||||
assert.equal(result.total, 1);
|
||||
assert.equal(result.groups[0]?.base, base);
|
||||
assert.equal(result.groups[0]?.title, '传世 · 史官落笔');
|
||||
assert.equal('sunoStyle' in result.groups[0], false);
|
||||
assert.equal('style' in result.groups[0], false);
|
||||
});
|
||||
|
||||
test('不存在的曲目锚点返回空列表,不回退到无关曲目', () => {
|
||||
const result = listGroups({ base: 'shishi:not-real' });
|
||||
assert.deepEqual(result, { total: 0, groups: [] });
|
||||
assert.equal(songForBase('shishi:not-real'), null);
|
||||
});
|
||||
|
||||
test('前后台曲库只发布有出处的诗词曲目', () => {
|
||||
const result = listGroups({ family: '诗词', limit: 1000 });
|
||||
|
||||
assert.equal(result.total, 646);
|
||||
assert.equal(result.groups.length, 646);
|
||||
assert.ok(result.groups.every((group) => group.provenance?.source));
|
||||
assert.equal(hasSong('shici:song-x093'), false);
|
||||
assert.equal(getSong('shici:song-x093'), null);
|
||||
assert.equal(listFlat({ family: '诗词', q: '红笺小字' }).total, 0);
|
||||
});
|
||||
|
||||
test('历史音乐带史源,平台原创配乐明确标注原创出处', () => {
|
||||
const battle = songForBase('zhanzhen:julu');
|
||||
const original = songForBase('shishi:chuanshi');
|
||||
|
||||
assert.equal(battle?.provenance?.kind, 'historical');
|
||||
assert.match(battle?.provenance?.source || '', /《史記·項羽本紀》/);
|
||||
assert.deepEqual(original?.provenance, { kind: 'original', source: '数字我·天下原创史诗配乐' });
|
||||
assert.equal(families().find((item) => item.family === '诗词')?.count, 646);
|
||||
assert.equal(songCount(), 1309);
|
||||
});
|
||||
Reference in New Issue
Block a user