In the examples for Paket dependency groups, there is often a "main" and "test" group:
source https://api.nuget.org/v3/index.json
storage: none
framework: netcoreapp3.1, netstandard2.1
nuget FSharp.Core
nuget FParsec
group test
source https://api.nuget.org/v3/index.json
nuget FSharp.Core
nuget FParsec
nuget xunit 2.4.1
nuget FsUnit.xUnit 3.8.0
In order to use a dependency in both the library code and the test code, I can add it to both groups.
But is there a way to say "match the version of nuget FParsec
in the test and the main groups"?
I recommend you don't use a test group and you put the test libraries in the main group instead. Any packages used in test runs should match versions used by the code being tested so there's no need to resolve dependencies separately. The latest version of the SAFE template follows this approach.
Groups can be useful if you have projects/scripts that really never share the same runtime. That's why the SAFE Template uses a Build group: Those dependencies are used in a FAKE script that don't depend directly on the rest on the app code.