Closed JamieMair closed 1 year ago
That should work just fine. The one thing that you do need to put in the [deps]
section is TestItems
if you want to use inline tests that are just part of your regular package code. But it is a very lightweight dependency: https://github.com/julia-vscode/TestItems.jl/blob/main/src/TestItems.jl.
I was able to figure our why I was getting the following error in the UI when trying to run the tests:
Unable to load the `Test` package. Please ensure that `Test` is listed as a test dependency in the Project.toml for the package.
I hadn't yet added the [targets]
listing as below, but the error goes away if you add Test
to the [deps]
section, which caused the confusion. This is fixed now by adding the [targets]
section:
[targets]
test = ["Test", "TestItemRunner", "TestItems"]
Requires having
Test
as a direct dependency of the project, instead of being part of the[extras]
dependency. E.g. it would be nice to work when theProject.toml
file looks like:Without having to list
Test
under the[deps]
section.