From d1fb051e0f39cde3fa0b28ebf9039e47512ed954 Mon Sep 17 00:00:00 2001 From: imccyu <276526105+imccyu@users.noreply.github.com> Date: Mon, 21 Sep 2026 22:41:17 +0800 Subject: [PATCH] test(web): stamp bootstrap artifacts before rebuild checks --- apps/web/tests/client-plugin-live.e2e.ts | 6 +++++- scripts/run-web-snapshots.ts | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/web/tests/client-plugin-live.e2e.ts b/apps/web/tests/client-plugin-live.e2e.ts index 452a7c36ce..0c3a6e8de8 100644 --- a/apps/web/tests/client-plugin-live.e2e.ts +++ b/apps/web/tests/client-plugin-live.e2e.ts @@ -2,7 +2,7 @@ import { fileURLToPath } from 'node:url' import { join } from 'node:path' import { tmpdir } from 'node:os' -import { cp, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises' +import { cp, mkdtemp, readFile, rm, stat, utimes, writeFile } from 'node:fs/promises' import { chromium, type Page } from 'playwright' import { expect, it, onTestFailed, onTestFinished } from 'vitest' import { @@ -256,6 +256,10 @@ it('reports bootstrap rebuilds without remounting the settings page or navigatin const originalInput = await draft.elementHandle() let navigations = 0 page.on('framenavigated', () => { navigations++ }) + const clientPath = scaffold.ctx.clientModules.clientPath('@deepseek-ai/dsh-client-modules')! + const originalStat = await stat(clientPath) + onTestFinished(() => utimes(clientPath, originalStat.atime, originalStat.mtime)) + await utimes(clientPath, originalStat.atime, new Date(originalStat.mtimeMs + 1_000)) scaffold.ctx.clientModules.rebuilt('@deepseek-ai/dsh-client-modules') const failure = page.locator('[data-client-sync-failure]') await failure.getByText(/replacing bootstrap module .* requires a page reload/).waitFor() diff --git a/scripts/run-web-snapshots.ts b/scripts/run-web-snapshots.ts index 0a02632ad0..cb05c2283c 100644 --- a/scripts/run-web-snapshots.ts +++ b/scripts/run-web-snapshots.ts @@ -4,6 +4,7 @@ import { pnpmInvocation } from './pnpm-invocation.ts' const serialFiles = [ 'apps/web/tests/hmr-live.e2e.ts', + 'apps/web/tests/client-plugin-live.e2e.ts', ] const workerRaw = process.env.DSH_WEB_SNAPSHOT_WORKERS const workers = Number.parseInt(workerRaw ?? '', 10)