mirror of
https://github.com/morluto/rea.git
synced 2026-11-14 10:43:30 +00:00
239 literal timeoutMs values on cli.run and processes.run only restated a guess at host speed. On hosted runners with four workers, cliOutput's 3-second value failed while the command still produced correct output. Deadlines that are the behavior under test, derived from an operation budget, or that bound a regression's wait remain. Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
41 lines
1.6 KiB
TypeScript
41 lines
1.6 KiB
TypeScript
import { fileURLToPath } from "node:url";
|
|
import { copyFile, mkdir } from "node:fs/promises";
|
|
import { dirname, join } from "node:path";
|
|
import { expect } from "vitest";
|
|
import { processTest } from "../../support/process/processFixture.js";
|
|
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
|
|
|
|
processTest(
|
|
"loads the Android fixture fetcher before build or dependency installation",
|
|
async ({ processes }) => {
|
|
const root = await createTestTempDirectory("rea-android-bootstrap-");
|
|
// Copy the actual bootstrap inputs into a checkout without dist or
|
|
// node_modules so an installed dependency cannot hide a new coupling.
|
|
for (const path of [
|
|
"scripts/fixtures/android/fetch.mjs",
|
|
"scripts/fixtures/android/apidemos.json",
|
|
"src/android/JadxRelease.ts",
|
|
]) {
|
|
const destination = join(root, path);
|
|
await mkdir(dirname(destination), { recursive: true });
|
|
await copyFile(
|
|
fileURLToPath(new URL(`../../../${path}`, import.meta.url)),
|
|
destination,
|
|
);
|
|
}
|
|
const entry = join(root, "scripts/fixtures/android/fetch.mjs");
|
|
// Invalid arguments stop before downloads while exercising Node's real
|
|
// source-module loading, without Vitest's .js-to-.ts resolution.
|
|
const result = await processes.run(process.execPath, [
|
|
entry,
|
|
"extra",
|
|
"argument",
|
|
]);
|
|
expect(result.exitCode).toBe(1);
|
|
expect(result.stderr).toContain(
|
|
"Usage: npm run fixtures:android -- [DIRECTORY]",
|
|
);
|
|
expect(result.stderr).not.toContain("ERR_MODULE_NOT_FOUND");
|
|
},
|
|
);
|