The Pkg documentation related to adding test-specific dependencies mentions the addition of the required packages under [extras] and [target] in the following way:
[extras]
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[targets]
test = ["Markdown", "Test"]
The add PackageName method is adding the PackageName under the [deps] - and I am unaware of any documented way to add the test-specific dependencies straightforwardly.
I always copy-pasted from [deps] and manually added the package names to the [targets] in my Project.toml file.
I had no problem with this before, but it gets a little annoying when the number of test-related packages is larger.
Is there something that I am missing? Some material that documents this and I failed to discover? How are you doing this?
Specifically - is there some variation of add PackageName command that will place the added packages under [extras] (and hopefully add the entries to [targets] also)?
P.S. I prefer the single file approach (using [targets]) - without creating the test/Project.toml file.