/
githubmirror
/
strapi
Обзор
Документация
Войти
/
githubmirror
/
strapi
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
examples/complex/scripts/run-bench-hook-smoke.js
34 строки
988 B
Ben Irvin
test(migration): version migration testing framework (#26060)
06 авг 2026, 15:39
Не верифицирован
06 авг 2026, 15:39
ac0c928
Код
Авторство
О чём код?
#!/usr/bin/env node /* eslint-disable no-console */ /** * Launcher for bench-hook-smoke.js — sets STRAPI_BENCH_HOOK_OUTPUT then spawns * node with `--import tsx --require ./bench-hook.ts` so the preload is active * before the smoke (scripts are TypeScript in this fixture). */ const { spawnSync } = require('child_process'); const fs = require('fs'); const os = require('os'); const path = require('path'); const hookPath = path.join(__dirname, 'bench-hook.ts'); const smokePath = path.join(__dirname, 'bench-hook-smoke.js'); const outputPath = path.join(os.tmpdir(), `strapi-bench-hook-smoke-${process.pid}.json`); const result = spawnSync(process.execPath, ['--import', 'tsx', '--require', hookPath, smokePath], { stdio: 'inherit', env: { ...process.env, STRAPI_BENCH_HOOK_OUTPUT: outputPath, }, cwd: path.join(__dirname, '..'), }); try { fs.unlinkSync(outputPath); } catch { // ignore missing output on failure paths } process.exit(result.status ?? 1);