diff options
author | 2023-07-29 00:46:44 +0200 | |
---|---|---|
committer | 2023-07-28 15:46:44 -0700 | |
commit | 242d8655d854c1b818c38d9b021a31d673638e1e (patch) | |
tree | 701763879bc87d96aca21aedc78294cbaf89ed0e /test/js | |
parent | 9b91e3c1a25548217d846932c14e3ccdd0942a99 (diff) | |
download | bun-242d8655d854c1b818c38d9b021a31d673638e1e.tar.gz bun-242d8655d854c1b818c38d9b021a31d673638e1e.tar.zst bun-242d8655d854c1b818c38d9b021a31d673638e1e.zip |
feat(bun/test): Impl. expect().pass() & expect().fail() (#3843)
* Impl. pass & fail
* fix
* fix 2
* smol
Diffstat (limited to 'test/js')
-rw-r--r-- | test/js/bun/test/jest-extended.test.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/test/js/bun/test/jest-extended.test.js b/test/js/bun/test/jest-extended.test.js index b03e0828f..5f84914f1 100644 --- a/test/js/bun/test/jest-extended.test.js +++ b/test/js/bun/test/jest-extended.test.js @@ -15,17 +15,22 @@ const inspect = isBun ? Bun.inspect : require("util").inspect; // https://jest-extended.jestcommunity.dev/docs/matchers/ describe("jest-extended", () => { - test.todo("pass()", () => { - expect(typeof expect().pass).toBe("function"); - expect(() => expect().not.pass()).toThrow(); + test("pass()", () => { + expect(expect().pass).toBeTypeOf("function"); + expect(() => expect("ignored value").not.pass()).toThrow("passes by .pass() assertion"); + expect(() => expect().not.pass("message here")).toThrow("message here"); + expect(() => expect().pass(1)).toThrow("Expected message to be a string for 'pass'."); expect().pass(); expect().pass("message ignored"); }); - test.todo("fail()", () => { - expect(typeof expect().fail).toBe("function"); + test("fail()", () => { + expect(expect().fail).toBeTypeOf("function"); expect(() => expect("ignored value").fail("message here")).toThrow("message here"); + expect(() => expect().fail()).toThrow("fails by .fail() assertion"); + expect(() => expect().fail(1)).toThrow("Expected message to be a string for 'fail'."); expect().not.fail(); + expect().not.fail("message ignored"); }); describe("toBeEmpty()", () => { |