mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 04:49:06 +00:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user