From 30b10d5fb1aeb94c7c19bb8d8d732f61202609cd Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Mon, 9 Jan 2023 08:28:37 -0800 Subject: [bun:test] Implement `test.root` configuration option --- src/bunfig.zig | 8 ++++++++ src/cli.zig | 2 ++ 2 files changed, 10 insertions(+) (limited to 'src') 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 { -- cgit v1.2.3