aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/generated_classes.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-06-09 16:38:06 -0700
committerGravatar GitHub <noreply@github.com> 2023-06-09 16:38:06 -0700
commitbf518222d456c913fc5e6b6e0d14952d76c0ce91 (patch)
tree99431a14fefb1b52b75ea0528b68232e8af2cb7c /src/bun.js/bindings/generated_classes.zig
parent6565bd89d533b17d0d975f2790a4b4d37d8aecc1 (diff)
downloadbun-bf518222d456c913fc5e6b6e0d14952d76c0ce91.tar.gz
bun-bf518222d456c913fc5e6b6e0d14952d76c0ce91.tar.zst
bun-bf518222d456c913fc5e6b6e0d14952d76c0ce91.zip
Implement mocks in bun:test (#3252)
* wip * wip * most of the code for mocks in bun:test * finishing up * Implement `toHaveBeenCalled` and `toHaveBeenCalledTimes(1)` * Test * visit * results, not returnValues * exact * Update jest.zig * A couple more tests * Add jest.fn * support resetting mocks * Implement spyOn --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/bun.js/bindings/generated_classes.zig')
-rw-r--r--src/bun.js/bindings/generated_classes.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bun.js/bindings/generated_classes.zig b/src/bun.js/bindings/generated_classes.zig
index d24c8c81f..a4bbd2cab 100644
--- a/src/bun.js/bindings/generated_classes.zig
+++ b/src/bun.js/bindings/generated_classes.zig
@@ -944,6 +944,8 @@ pub const JSExpect = struct {
@compileLog("Expected Expect.toEndWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toEndWith)));
if (@TypeOf(Expect.toEqual) != CallbackType)
@compileLog("Expected Expect.toEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toEqual)));
+ if (@TypeOf(Expect.toHaveBeenCalled) != CallbackType)
+ @compileLog("Expected Expect.toHaveBeenCalled to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveBeenCalled)));
if (@TypeOf(Expect.toHaveBeenCalledTimes) != CallbackType)
@compileLog("Expected Expect.toHaveBeenCalledTimes to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveBeenCalledTimes)));
if (@TypeOf(Expect.toHaveBeenCalledWith) != CallbackType)
@@ -1069,6 +1071,7 @@ pub const JSExpect = struct {
@export(Expect.toContainEqual, .{ .name = "ExpectPrototype__toContainEqual" });
@export(Expect.toEndWith, .{ .name = "ExpectPrototype__toEndWith" });
@export(Expect.toEqual, .{ .name = "ExpectPrototype__toEqual" });
+ @export(Expect.toHaveBeenCalled, .{ .name = "ExpectPrototype__toHaveBeenCalled" });
@export(Expect.toHaveBeenCalledTimes, .{ .name = "ExpectPrototype__toHaveBeenCalledTimes" });
@export(Expect.toHaveBeenCalledWith, .{ .name = "ExpectPrototype__toHaveBeenCalledWith" });
@export(Expect.toHaveBeenLastCalledWith, .{ .name = "ExpectPrototype__toHaveBeenLastCalledWith" });