perf: 缓存淘汰测试用极短输入替代完整 parseMarkdown,CI 提速
CI / test (20.x) (push) Canceled after 0s
CI / test (22.x) (push) Canceled after 0s
CI / test (24.x) (push) Canceled after 0s
CI / test (18.x) (push) Canceled after 1h37m45s

This commit is contained in:
2026-07-25 17:41:14 +08:00
parent 6a9d6c2263
commit b7a3da8176
+3 -3
View File
@@ -908,10 +908,10 @@ describe('parseMarkdown - v0.1.15 registerBlockHandler', () => {
describe('parseMarkdown - 覆盖率:渲染缓存淘汰', () => {
test('缓存超过上限触发 FIFO 淘汰', () => {
// MAX_CACHE_SIZE = 300,填充 301 个不同文本触发淘汰
// MAX_CACHE_SIZE = 300,填充 301 个极短文本触发淘汰(避免 CI 超时)
const short = 'x';
for (let i = 0; i < 301; i++) {
const text = `text ${i} **bold**`;
parseMarkdown(text);
parseMarkdown(short + i);
}
// 不应抛错,且至少有一次淘汰发生
expect(true).toBe(true);