diff --git a/test/integration/bun-types/fixture/5396.test.ts b/test/integration/bun-types/fixture/5396.test.ts new file mode 100644 index 0000000000..3f51baef0b --- /dev/null +++ b/test/integration/bun-types/fixture/5396.test.ts @@ -0,0 +1,28 @@ +import { describe, expect, it, jest, mock, spyOn } from "bun:test"; + +class AnyDTO { + anyField: string = "any_value"; +} + +class AnyClass { + async anyMethod(): Promise { + return new AnyDTO(); + } +} + +const anyObject: AnyClass = { + anyMethod: jest.fn(), +}; + +describe("Any describe", () => { + it("should return any value", async () => { + spyOn(anyObject, "anyMethod").mockResolvedValue({ anyField: "any_value" }); + const anyValue = await anyObject.anyMethod(); + + expect(anyValue).toEqual({ anyField: "any_value" }); + }); +}); + +const mockSomething = mock((): string => "hi"); +mockSomething.mockImplementation(() => "hello"); +mockSomething.mockReturnValue("hello");