Skip to content

Satisfying#16242

Open
fhaziz0730 wants to merge 8 commits into
jestjs:mainfrom
fhaziz0730:satisfying
Open

Satisfying#16242
fhaziz0730 wants to merge 8 commits into
jestjs:mainfrom
fhaziz0730:satisfying

Conversation

@fhaziz0730

@fhaziz0730 fhaziz0730 commented Jun 16, 2026

Copy link
Copy Markdown

Summary

Implemented a new asymmetric matcher for wrapping (value) => boolean predicates to be used anywhere an asymmetric matcher is accepted.

  • Created a new Satisfying class in packages/expect/src/asymmetricMatchers.ts that evaluates a value given a predicate.
  • Added Satisfying class to expect module as expect.satsifying and expect.not.satisfying in packages/expect/src/index.ts
  • Added unit tests for Satisfying class in packages/expect/src/tests/asymmetricMatchers.test.ts
  • Added end-to-end tests for Satisfying in e2e/satisfying and added integration test at e2e/tests/satisfying.test.ts

First time contributing to open source software, so any improvement/suggestions help!
Resolves #16193

Test plan

yarn test
yarn jest asymmetricMatchers.test.ts
cd e2e/satisfying; node ../../packages/jest-cli/bin/jest.js

@netlify

netlify Bot commented Jun 16, 2026

Copy link
Copy Markdown

Deploy Preview for jestjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 17bfebe
🔍 Latest deploy log https://app.netlify.com/projects/jestjs/deploys/6a32fddff378f60008e90dee
😎 Deploy Preview https://deploy-preview-16242--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the require-changelog If a PR does requires a changelog entry label Jun 16, 2026
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 16, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

@pkg-pr-new

pkg-pr-new Bot commented Jun 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

babel-jest

npm i https://pkg.pr.new/babel-jest@16242

babel-plugin-jest-hoist

npm i https://pkg.pr.new/babel-plugin-jest-hoist@16242

babel-preset-jest

npm i https://pkg.pr.new/babel-preset-jest@16242

create-jest

npm i https://pkg.pr.new/create-jest@16242

@jest/diff-sequences

npm i https://pkg.pr.new/@jest/diff-sequences@16242

expect

npm i https://pkg.pr.new/expect@16242

@jest/expect-utils

npm i https://pkg.pr.new/@jest/expect-utils@16242

jest

npm i https://pkg.pr.new/jest@16242

jest-changed-files

npm i https://pkg.pr.new/jest-changed-files@16242

jest-circus

npm i https://pkg.pr.new/jest-circus@16242

jest-cli

npm i https://pkg.pr.new/jest-cli@16242

jest-config

npm i https://pkg.pr.new/jest-config@16242

@jest/console

npm i https://pkg.pr.new/@jest/console@16242

@jest/core

npm i https://pkg.pr.new/@jest/core@16242

@jest/create-cache-key-function

npm i https://pkg.pr.new/@jest/create-cache-key-function@16242

jest-diff

npm i https://pkg.pr.new/jest-diff@16242

jest-docblock

npm i https://pkg.pr.new/jest-docblock@16242

jest-each

npm i https://pkg.pr.new/jest-each@16242

@jest/environment

npm i https://pkg.pr.new/@jest/environment@16242

jest-environment-jsdom

npm i https://pkg.pr.new/jest-environment-jsdom@16242

@jest/environment-jsdom-abstract

npm i https://pkg.pr.new/@jest/environment-jsdom-abstract@16242

jest-environment-node

npm i https://pkg.pr.new/jest-environment-node@16242

@jest/expect

npm i https://pkg.pr.new/@jest/expect@16242

@jest/fake-timers

npm i https://pkg.pr.new/@jest/fake-timers@16242

@jest/get-type

npm i https://pkg.pr.new/@jest/get-type@16242

@jest/globals

npm i https://pkg.pr.new/@jest/globals@16242

jest-haste-map

npm i https://pkg.pr.new/jest-haste-map@16242

jest-jasmine2

npm i https://pkg.pr.new/jest-jasmine2@16242

jest-leak-detector

npm i https://pkg.pr.new/jest-leak-detector@16242

jest-matcher-utils

npm i https://pkg.pr.new/jest-matcher-utils@16242

jest-message-util

npm i https://pkg.pr.new/jest-message-util@16242

jest-mock

npm i https://pkg.pr.new/jest-mock@16242

@jest/pattern

npm i https://pkg.pr.new/@jest/pattern@16242

jest-phabricator

npm i https://pkg.pr.new/jest-phabricator@16242

jest-regex-util

npm i https://pkg.pr.new/jest-regex-util@16242

@jest/reporters

npm i https://pkg.pr.new/@jest/reporters@16242

jest-resolve

npm i https://pkg.pr.new/jest-resolve@16242

jest-resolve-dependencies

npm i https://pkg.pr.new/jest-resolve-dependencies@16242

jest-runner

npm i https://pkg.pr.new/jest-runner@16242

jest-runtime

npm i https://pkg.pr.new/jest-runtime@16242

@jest/schemas

npm i https://pkg.pr.new/@jest/schemas@16242

jest-snapshot

npm i https://pkg.pr.new/jest-snapshot@16242

@jest/snapshot-utils

npm i https://pkg.pr.new/@jest/snapshot-utils@16242

@jest/source-map

npm i https://pkg.pr.new/@jest/source-map@16242

@jest/test-result

npm i https://pkg.pr.new/@jest/test-result@16242

@jest/test-sequencer

npm i https://pkg.pr.new/@jest/test-sequencer@16242

@jest/transform

npm i https://pkg.pr.new/@jest/transform@16242

@jest/types

npm i https://pkg.pr.new/@jest/types@16242

jest-util

npm i https://pkg.pr.new/jest-util@16242

jest-validate

npm i https://pkg.pr.new/jest-validate@16242

jest-watcher

npm i https://pkg.pr.new/jest-watcher@16242

jest-worker

npm i https://pkg.pr.new/jest-worker@16242

pretty-format

npm i https://pkg.pr.new/pretty-format@16242

commit: 17bfebe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

require-changelog If a PR does requires a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: expect.satisfying(fn) — predicate-based asymmetric matcher

1 participant