test: update expect.test.js to expect promises for resolves/rejects

Updated the test expectations to verify that matchers under
.resolves and .rejects now correctly return Promise instances
instead of undefined.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude Bot
2025-10-10 19:33:12 +00:00
parent ddc6bfdfb5
commit bbc3e79b68

View File

@@ -4671,11 +4671,11 @@ describe("expect()", () => {
test("pass to return undefined", () => {
expect(expect().pass()).toBeUndefined();
});
test("rejects to return undefined", () => {
expect(expect(Promise.reject("error")).rejects.toBe("error")).toBeUndefined();
test("rejects to return promise", () => {
expect(expect(Promise.reject("error")).rejects.toBe("error")).toBeInstanceOf(Promise);
});
test("resolves to return undefined", () => {
expect(expect(Promise.resolve(1)).resolves.toBe(1)).toBeUndefined();
test("resolves to return promise", () => {
expect(expect(Promise.resolve(1)).resolves.toBe(1)).toBeInstanceOf(Promise);
});
test("toBe to return undefined", () => {
expect(expect(true).toBe(true)).toBeUndefined();