初始仓库迁移
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
2026-04-04 23:57:06 +08:00
parent 80986b790d
commit c49c64896a
18446 changed files with 532435 additions and 2 deletions

View File

@@ -0,0 +1,33 @@
import fs from 'node:fs';
import path from 'node:path';
import { WorldType } from '../types';
import { getDefaultCustomWorldSceneImage } from './customWorldVisuals';
import { getScenePresetsByWorld } from './scenePresets';
function resolvePublicAssetPath(assetPath: string) {
return path.resolve(process.cwd(), 'public', assetPath.replace(/^\/+/, ''));
}
describe('scene background assets', () => {
it('ships background files for every wuxia and xianxia scene preset', () => {
const scenes = [
...getScenePresetsByWorld(WorldType.WUXIA),
...getScenePresetsByWorld(WorldType.XIANXIA),
];
expect(scenes.length).toBeGreaterThan(0);
for (const scene of scenes) {
expect(fs.existsSync(resolvePublicAssetPath(scene.imageSrc))).toBe(true);
}
});
it('returns existing default custom world backgrounds for both anchor worlds', () => {
const wuxiaImage = getDefaultCustomWorldSceneImage('seed', 0, WorldType.WUXIA);
const xianxiaImage = getDefaultCustomWorldSceneImage('seed', 0, WorldType.XIANXIA);
expect(fs.existsSync(resolvePublicAssetPath(wuxiaImage))).toBe(true);
expect(fs.existsSync(resolvePublicAssetPath(xianxiaImage))).toBe(true);
});
});