2026-06-30 00:27:15 +08:00
|
|
|
import { spawnSync } from 'node:child_process';
|
|
|
|
|
import path from 'node:path';
|
|
|
|
|
|
|
|
|
|
const root = path.resolve(new URL('..', import.meta.url).pathname);
|
|
|
|
|
const withRuntime =
|
|
|
|
|
process.argv.includes('--with-runtime') || process.env.MINDSPACE_VERIFY_RUNTIME === '1';
|
|
|
|
|
|
|
|
|
|
function run(label, args) {
|
|
|
|
|
const result = spawnSync(process.execPath, args, {
|
|
|
|
|
cwd: root,
|
|
|
|
|
stdio: 'inherit',
|
|
|
|
|
});
|
|
|
|
|
if (result.status !== 0) {
|
|
|
|
|
throw new Error(`${label} failed with exit code ${result.status ?? 'unknown'}`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
run('MindSpace publish + chat finish unit tests', [
|
|
|
|
|
'--test',
|
|
|
|
|
'mindspace-public-finish-sync.test.mjs',
|
2026-07-06 14:19:48 +08:00
|
|
|
'mindspace-h5-html-finish-guard.test.mjs',
|
2026-06-30 00:27:15 +08:00
|
|
|
'conversation-display.test.mjs',
|
|
|
|
|
'chat-finish-sync.test.mjs',
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
run('chat finish sync source guards', ['scripts/verify-chat-finish-sync.mjs']);
|
|
|
|
|
|
|
|
|
|
if (withRuntime) {
|
|
|
|
|
run('public finish sync runtime guard', ['scripts/verify-public-finish-sync-runtime.mjs']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log(
|
|
|
|
|
withRuntime
|
|
|
|
|
? 'mindspace publish + chat finish regression guards ok (with runtime)'
|
|
|
|
|
: 'mindspace publish + chat finish regression guards ok',
|
|
|
|
|
);
|