timkindberg / jest-when

Jest support for mock argument-matched return values.
MIT License
734 stars 38 forks source link

make jest/expect an peer deps? #81

Closed chyzwar closed 2 years ago

chyzwar commented 3 years ago

Currently jest-when use expect v24, unless user of library also use jest v24 whole swats of jest specific dependencies are duplicated. I suggest that jest-when declare jest as peer dep with version like "jest": ">= 24"

ericcornelissen commented 3 years ago

I second this with the additional concern that Jest v24's dependency tree depends on two deprecated packages, namely resolve-url and urix, see:

[...]
├─┬ jest-when@3.3.1
│ └─┬ expect@24.9.0
│   ├─┬ jest-message-util@24.9.0
│   │ ├─┬ micromatch@3.1.10
│   │ │ ├─┬ snapdragon@0.8.2
│   │ │ │ ├─┬ source-map-resolve@0.5.3
│   │ │ │ │ ├── atob@2.1.2
│   │ │ │ │ ├── decode-uri-component@0.2.0
│   │ │ │ │ ├── resolve-url@0.2.1                <--
│   │ │ │ │ ├── source-map-url@0.4.1
│   │ │ │ │ └── urix@0.1.0                       <--
[...]

EDIT: the same also goes for set-value, see:

└─┬ jest-when@3.3.1
  └─┬ expect@24.9.0
    └─┬ jest-message-util@24.9.0
      └─┬ micromatch@3.1.10
        └─┬ snapdragon@0.8.2
          └─┬ base@0.11.2
            └─┬ cache-base@1.0.1
              ├── set-value@2.0.1               <--
              └─┬ union-value@1.0.1
                └── set-value@2.0.1 (deduped)   <--
chyzwar commented 3 years ago

@timkindberg If you are in favor of this change, I can try to create PR.

timkindberg commented 3 years ago

Yes pls I keep trying to find some time but it's a busy time when kids are going back to school. Thank you!!