feat(FN-2102): merge fusion/fn-2102
This commit is contained in:
@@ -15,6 +15,10 @@ const SUPPORTED_TARGETS = [
|
||||
"bun-windows-x64",
|
||||
] as const;
|
||||
|
||||
function hasKnownBunSqliteLimitation(result: { stdout: string; stderr: string }): boolean {
|
||||
return /node:sqlite/i.test(`${result.stdout}\n${result.stderr}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Map target → expected binary filename (mirrors build.ts logic).
|
||||
*/
|
||||
@@ -125,8 +129,7 @@ describe("build-exe-cross: --all builds all platforms", () => {
|
||||
encoding: "utf-8",
|
||||
timeout: 15_000,
|
||||
});
|
||||
const knownBunSqliteLimitation = result.stderr.includes("No such built-in module: node:sqlite");
|
||||
if (knownBunSqliteLimitation) {
|
||||
if (hasKnownBunSqliteLimitation(result)) {
|
||||
return;
|
||||
}
|
||||
expect(result.status).toBe(0);
|
||||
|
||||
@@ -30,8 +30,8 @@ function createIsolatedDir(): { dir: string; binary: string; cleanup: () => void
|
||||
};
|
||||
}
|
||||
|
||||
function hasKnownBunSqliteLimitation(result: { stderr: string | null }): boolean {
|
||||
return result.stderr?.includes("No such built-in module: node:sqlite") ?? false;
|
||||
function hasKnownBunSqliteLimitation(result: { stdout: string | null; stderr: string | null }): boolean {
|
||||
return /node:sqlite/i.test(`${result.stdout ?? ""}\n${result.stderr ?? ""}`);
|
||||
}
|
||||
|
||||
async function stopChildProcess(child: ChildProcess | null): Promise<void> {
|
||||
@@ -159,7 +159,7 @@ describe("build-exe", () => {
|
||||
|
||||
const outcome = await new Promise<"ready" | "sqlite-unsupported">(
|
||||
(resolve, reject) => {
|
||||
const SQLITE_ERROR = "No such built-in module: node:sqlite";
|
||||
const SQLITE_ERROR_PATTERN = /node:sqlite/i;
|
||||
|
||||
const timeout = setTimeout(() => {
|
||||
if (settled) return;
|
||||
@@ -197,7 +197,7 @@ describe("build-exe", () => {
|
||||
|
||||
child!.stderr!.on("data", (d: Buffer) => {
|
||||
startupOutput += d.toString();
|
||||
if (startupOutput.includes(SQLITE_ERROR)) {
|
||||
if (SQLITE_ERROR_PATTERN.test(startupOutput)) {
|
||||
settle("sqlite-unsupported");
|
||||
}
|
||||
});
|
||||
@@ -205,7 +205,7 @@ describe("build-exe", () => {
|
||||
// 'close' fires after all stdio streams are drained, so
|
||||
// startupOutput is guaranteed to be complete here.
|
||||
child!.on("close", (code) => {
|
||||
if (startupOutput.includes(SQLITE_ERROR)) {
|
||||
if (SQLITE_ERROR_PATTERN.test(startupOutput)) {
|
||||
settle("sqlite-unsupported");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user