Files
Genarrative/apps/ai-game-creator-shell/tests/projectPathNotification.test.ts
T
kdletters 33369f1180
Project CI / AI game creator shell Rust shard 1/4 (push) Successful in 5m27s
Project CI / AI game creator shell Rust smoke (push) Successful in 2m5s
Project CI / AI game creator shell Rust shard 2/4 (push) Successful in 4m50s
Project CI / AI game creator shell Rust shard 3/4 (push) Successful in 5m13s
Project CI / AI game creator shell Rust crates (push) Successful in 2m2s
Project CI / AI game creator shell Rust shard 4/4 (push) Successful in 4m12s
Project CI / Repository checks (push) Successful in 4m16s
Project CI / Frontend tests (push) Successful in 5m8s
Project CI / Native shell tests (push) Successful in 6m31s
Project CI / Backend tests (push) Successful in 7m32s
Project CI / AI game creator shell web tests (push) Successful in 4m12s
修复生图资产实时刷新
兼容 Windows 普通、verbatim 与 UNC 项目路径的失效事件匹配

让普通生图成功后立即发送 manifest 刷新通知

补充资源卡片与桥接通知回归测试
2026-09-15 10:37:47 +08:00

27 lines
1.1 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { projectPathsMatchForInvalidation } from '../src/features/project-summary/projectPath';
describe('项目刷新事件路径', () => {
it.each([
['C:\\Projects\\game', '\\\\?\\C:\\Projects\\game'],
['\\\\?\\C:\\Projects\\game', 'c:/Projects/game/'],
['\\\\server\\share\\game', '\\\\?\\UNC\\server\\share\\game'],
['/tmp/game', '/tmp/game'],
])('识别同一项目 %s 与 %s', (eventPath, activePath) => {
expect(projectPathsMatchForInvalidation(eventPath, activePath)).toBe(true);
});
it.each([
['\\\\?\\C:\\Projects\\game-other', 'C:\\Projects\\game'],
['\\\\?\\C:\\Projects\\game\\child', 'C:\\Projects\\game'],
['\\\\?\\UNC\\other\\share\\game', '\\\\server\\share\\game'],
['\\\\.\\C:\\Projects\\game', 'C:\\Projects\\game'],
['/tmp/Game', '/tmp/game'],
['', ''],
['C:\\Projects\\game', null],
])('拒绝其它项目或空作用域 %s 与 %s', (eventPath, activePath) => {
expect(projectPathsMatchForInvalidation(eventPath, activePath)).toBe(false);
});
});