watson / test-all-versions

Run your test suite against all published versions of a dependency
MIT License
51 stars 8 forks source link

Provide a way to test groups of packages in version jumps #1

Open Graham42 opened 7 years ago

Graham42 commented 7 years ago

Use case: I want to test against react-dom 0.14 or 15.x which requires a peer dependency of react. However the version that is needed is always in sync. This will be true for any large package group managed with https://lernajs.io/

Something like this currently doesn't work

react-dom:
  peerDependencies: react
  versions: 0.14.x || 15.3.x
  commands: npm run test

Wondering if you could extend the config to allow a structure that can specify any number of packages. And then run the tests upgrading those packages in sync.

Example:

react-test-1:
  packages:
    - react
    - react-dom
  versions: 0.14.x || 15.3.x
  commands: npm run test

Thoughts?

watson commented 6 years ago

If I understand your use case correctly, I think this can be solved using custom named groups, each with it's own peerDependency property. I've done that to test the express-graphql module where each version requires a different version of the graphql module to be installed. You can see an example of that in the Opbeat .tav.yml file.

That being said, your idea of a syntax allowing the packages to stay in sync if they use the same version number is intriguing. When I get time I'll look into adding it 😃 PR's are welcome as well of course.

tlrobinson commented 5 years ago

I have the same use case. I like @Graham42's proposal.