diff --git a/src/bun.js/test/jest.zig b/src/bun.js/test/jest.zig index eed2d774f1..4c26de0b0e 100644 --- a/src/bun.js/test/jest.zig +++ b/src/bun.js/test/jest.zig @@ -529,30 +529,13 @@ pub const Jest = struct { pub fn call( globalObject: *JSGlobalObject, - callframe: *CallFrame, + _: *CallFrame, ) bun.JSError!JSValue { const vm = globalObject.bunVM(); if (vm.is_in_preload or runner == null) { return Bun__Jest__testPreloadObject(globalObject); } - const arguments = callframe.arguments_old(2).slice(); - - if (arguments.len < 1 or !arguments[0].isString()) { - return globalObject.throw("Bun.jest() expects a string filename", .{}); - } - var str = try arguments[0].toSlice(globalObject, bun.default_allocator); - defer str.deinit(); - const slice = str.slice(); - - if (!std.fs.path.isAbsolute(slice)) { - return globalObject.throw("Bun.jest() expects an absolute file path, got '{s}'", .{slice}); - } - - const filepath = Fs.FileSystem.instance.filename_store.append([]const u8, slice) catch unreachable; - var scope = runner.?.getOrPutFile(filepath); - scope.push(); - return Bun__Jest__testModuleObject(globalObject); } @@ -2495,7 +2478,6 @@ const ExpectTypeOf = expect.ExpectTypeOf; const bun = @import("bun"); const ArrayIdentityContext = bun.ArrayIdentityContext; const Environment = bun.Environment; -const Fs = bun.fs; const MutableString = bun.MutableString; const Output = bun.Output; const RegularExpression = bun.RegularExpression; diff --git a/src/cli/test_command.zig b/src/cli/test_command.zig index a23dfdcd40..2043482111 100644 --- a/src/cli/test_command.zig +++ b/src/cli/test_command.zig @@ -1816,6 +1816,10 @@ pub const TestCommand = struct { const file_path = resolution.path_pair.primary.text; const file_title = bun.path.relative(FileSystem.instance.top_level_dir, file_path); + const filepath = bun.fs.FileSystem.instance.filename_store.append([]const u8, file_path) catch unreachable; + var scope = bun.jsc.Jest.Jest.runner.?.getOrPutFile(filepath); + scope.push(); + // In Github Actions, append a special prefix that will group // subsequent log lines into a collapsable group. // https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines diff --git a/test/internal/ban-limits.json b/test/internal/ban-limits.json index 4e4318a1d2..888fa130fe 100644 --- a/test/internal/ban-limits.json +++ b/test/internal/ban-limits.json @@ -3,7 +3,7 @@ " == undefined": 0, "!= alloc.ptr": 0, "!= allocator.ptr": 0, - ".arguments_old(": 279, + ".arguments_old(": 278, ".jsBoolean(false)": 0, ".jsBoolean(true)": 0, ".stdDir()": 41,