[Feature]: Expose equals from expect package.
See original GitHub issue🚀 Feature Proposal
Slightly popular package jest-when(https://www.npmjs.com/package/jest-when) that depend on “expect” use portion of private api require('expect/build/jasmineUtils')
I just raised PR to use jest as peer https://github.com/timkindberg/jest-when/pull/84
We would like to ask jest to expose “equals” from jasmineUtils or provide suitable API to get current equals matcher.
Motivation
- I am worried that can break with ESM enforcing exports fields
- jest-when use private api it is withing jest project rights to break it on minor releases.
- Hopefully jest project consider adding jest-when functionality to core as it is useful and good API
Example
No response
Pitch
See above motivation. Either expose equals or provide jest-when compatible functionality in core.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:9
Top Results From Across the Web
expect | Yarn - Package Manager
This package exports the expect function used in Jest. You can find its documentation on Jest's website. readme. expect. This package exports the...
Read more >Expect · Jest
The expect function is used every time you want to test a value. You will rarely call expect by itself. Instead, you will...
Read more >Assertion Styles - Chai
Expect. The BDD style is exposed through expect or should interfaces. In both scenarios, you chain together natural language assertions. var expect =...
Read more >7. Package Description — Cabal 3.4.0.0 User's Guide
At most one library, exposing a number of Haskell modules. ... These can be used to enable or disable certain features of a...
Read more >Cannot mock a module with jest, and test function calls
I wrote a React component that I'm trying to test. The component is requiring another javascript file, exposing a function. My search.js file...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hmm, I guess this isn’t a custom matcher, but used within the mock function itself? That’s a bit more tricky. Essentially same as #11816
Hi @ErisDS, and thanks for the detailed use case! I’ll be adding a separate
@jest/expect-utils
in Jest 28 🙂 It’ll suddenly be available.jest-snapshot
itself also uses “private” stuff fromexpect