aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bunfig.toml11
-rw-r--r--src/bunfig.zig8
-rw-r--r--src/cli.zig2
3 files changed, 21 insertions, 0 deletions
diff --git a/bunfig.toml b/bunfig.toml
new file mode 100644
index 000000000..6d9b1c272
--- /dev/null
+++ b/bunfig.toml
@@ -0,0 +1,11 @@
+
+
+
+[test]
+# Large monorepos (like Bun) may want to specify the test directory more specifically
+# By default, `bun wiptest` scans every single folder recurisvely which, if you
+# have a gigantic submodule (like WebKit), it has to do lots of directory
+# traversals
+#
+# Instead, we can just make it scan only the test directory for Bun's runtime tests
+root = "test/bun.js"
diff --git a/src/bunfig.zig b/src/bunfig.zig
index f840c7c58..10a35edd4 100644
--- a/src/bunfig.zig
+++ b/src/bunfig.zig
@@ -191,6 +191,14 @@ pub const Bunfig = struct {
}
}
+ if (comptime cmd == .TestCommand) {
+ if (json.get("test")) |test_| {
+ if (test_.get("root")) |root| {
+ this.ctx.debug.test_directory = root.asString(this.allocator) orelse "";
+ }
+ }
+ }
+
if (comptime cmd.isNPMRelated() or cmd == .RunCommand or cmd == .AutoCommand) {
if (json.get("install")) |_bun| {
var install: *Api.BunInstall = this.ctx.install orelse brk: {
diff --git a/src/cli.zig b/src/cli.zig
index f18ce68ee..34677308d 100644
--- a/src/cli.zig
+++ b/src/cli.zig
@@ -838,6 +838,8 @@ pub const Command = struct {
macros: ?MacroMap = null,
editor: string = "",
package_bundle_map: bun.StringArrayHashMapUnmanaged(options.BundlePackage) = bun.StringArrayHashMapUnmanaged(options.BundlePackage){},
+
+ test_directory: []const u8 = "",
};
pub const Context = struct {