Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports
Path: blob/main/lang/bun/files/patch-test_integration_next-pages_test_dev-server-ssr-100.test.ts
46591 views
1
-- Skip gracefully when bun:internal-for-testing is unavailable (release builds).
2
-- bun:internal-for-testing is only compiled into debug/development builds of bun.
3
-- FreeBSD ports always build a release binary, so this module is never available.
4
-- Without this patch, the test file crashes at module load time with ENOENT,
5
-- causing "Unhandled error between tests" in the bun test output.
6
--- test/integration/next-pages/test/dev-server-ssr-100.test.ts.orig2026-04-27 17:51:47 UTC
7
+++ test/integration/next-pages/test/dev-server-ssr-100.test.ts
8
@@ -1,12 +1,24 @@
9
import { Subprocess } from "bun";
10
-import { install_test_helpers } from "bun:internal-for-testing";
11
-import { afterAll, beforeAll, expect, test } from "bun:test";
12
+// bun:internal-for-testing is only available in debug builds; skip gracefully in release builds.
13
+let install_test_helpers: any;
14
+try {
15
+ ({ install_test_helpers } = require("bun:internal-for-testing") as any);
16
+} catch {
17
+ install_test_helpers = null;
18
+}
19
+import { afterAll, beforeAll, describe, expect, test } from "bun:test";
20
import { copyFileSync } from "fs";
21
import { cp, rm } from "fs/promises";
22
import PQueue from "p-queue";
23
import { join } from "path";
24
import { StringDecoder } from "string_decoder";
25
import { bunEnv, bunExe, tmpdirSync, toMatchNodeModulesAt } from "../../../harness";
26
+
27
+if (!install_test_helpers) {
28
+ describe.skip("next-pages dev server (bun:internal-for-testing unavailable in release builds)", () => {
29
+ test("skipped", () => {});
30
+ });
31
+} else {
32
const { parseLockfile } = install_test_helpers;
33
34
expect.extend({ toMatchNodeModulesAt });
35
@@ -172,3 +184,4 @@
36
},
37
timeout,
38
);
39
+}
40
41