From 76cf465cc2e87c400b6bea56cad1f17f94b91da2 Mon Sep 17 00:00:00 2001 From: Dylan Conway <35280289+dylan-conway@users.noreply.github.com> Date: Fri, 9 Jun 2023 19:26:36 -0700 Subject: `toMatchObject` and some asymmetric matchers (#3260) * `toMatchObject` progress * add `expect.stringContaining()` * add `expect.stringMatching()` * print asymmetric matchers * cleanup * return before printing if constructor value isn't there * move matcher logic to cpp * pretty format and tests * fix formatting for snapshots * format `stringContaining` and `stringMatching` like jest * better test * remove commented tests * remove old property matcher code * add types * make sure all props are matched in arrays * add `Bun.deepMatch` --- src/bun.js/test/jest.classes.ts | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src/bun.js/test/jest.classes.ts') diff --git a/src/bun.js/test/jest.classes.ts b/src/bun.js/test/jest.classes.ts index de9f260d2..38eefe778 100644 --- a/src/bun.js/test/jest.classes.ts +++ b/src/bun.js/test/jest.classes.ts @@ -1,6 +1,17 @@ import { define } from "../scripts/class-definitions"; export default [ + define({ + name: "ExpectAnything", + construct: false, + noConstructor: true, + call: true, + finalize: true, + JSType: "0b11101110", + configurable: false, + klass: {}, + proto: {}, + }), define({ name: "ExpectAny", construct: false, @@ -13,6 +24,30 @@ export default [ klass: {}, proto: {}, }), + define({ + name: "ExpectStringContaining", + construct: false, + noConstructor: true, + call: true, + finalize: true, + JSType: "0b11101110", + values: ["stringValue"], + configurable: false, + klass: {}, + proto: {}, + }), + define({ + name: "ExpectStringMatching", + construct: false, + noConstructor: true, + call: true, + finalize: true, + JSType: "0b11101110", + values: ["testValue"], + configurable: false, + klass: {}, + proto: {}, + }), define({ name: "Expect", construct: true, -- cgit v1.2.3