# Prerelease of new testing framework and test run UI in VS Code

**URL:** https://discourse.julialang.org/t/prerelease-of-new-testing-framework-and-test-run-ui-in-vs-code/86355
**Category:** VS Code
**Created:** [August 25, 2022, 7:37pm UTC](https://discourse.julialang.org/t/prerelease-of-new-testing-framework-and-test-run-ui-in-vs-code/86355 "2022-08-25T19:37:13Z")
**Posts on this page:** 1
**Showing post:** 22

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [September 8, 2022, 4:10pm UTC](https://discourse.julialang.org/t/prerelease-of-new-testing-framework-and-test-run-ui-in-vs-code/86355/22 "2022-09-08T16:10:50Z")

</div>

Here is a working case: [GitHub - lmiq/TestTests.jl](https://github.com/lmiq/TestTests.jl)

- You do need to `] add Tests`, yes (@davidanthoff can this be lifted? Seems redudant, isn’t `Test` a dependency of `TestItemRunner`, which could reexport the `Test` macros?)
- In the [main module](https://github.com/lmiq/TestTests.jl/blob/main/src/TestTests.jl) of the package you only need to put `using TestItems`
- In [`runtests.jl`](https://github.com/lmiq/TestTests.jl/blob/main/test/runtests.jl) you need to use `using TestItemRunner`

The `Project.toml` must look like this one: [TestTests.jl/Project.toml at main · lmiq/TestTests.jl · GitHub](https://github.com/lmiq/TestTests.jl/blob/main/Project.toml)

I tested removing the `test/runtests.jl` file, and the test items inside the main module continue to work.

Does this work for you? You can clone that package and check, of course.

In other works, a step by step would be:

# Step by step

### Packages to add:

```julia-auto
import Pkg; Pkg.add("Test", "TestItems", "TestItemRunner")

```

### Project.toml (see example [here](https://github.com/lmiq/TestTests.jl/blob/main/Project.toml))

- Move `TestItemRunner` and `Test` to `[extras] `
- On `[targets]`, have `test = ["Test", TestItemRunner"]` (and other deps if needed).

### Main code of the package

Add `using Testitems` in the main module, and `@testitem`(s):

```julia-auto
module MyPackage
    using TestItems
    f(x) = 1

    @testitem "my test" begin
        using MyPackage # must be self-contained!
        @test MyPackage.f(1) == 1
    end
end

```

### The `test/runtests.jl` file:

Must look like this:

```julia-auto
using TestItemRunner

# other items can be here
@testitem "my other test" begin
    using MyPackage
    @test MyPackage.f(2) == 1
end

@run_package_tests

```

---

_[View the full topic](https://discourse.julialang.org/t/prerelease-of-new-testing-framework-and-test-run-ui-in-vs-code/86355)._
