Debugger doesn't stop at breakpoints when running tests (but does during normal execution)

An (hopefully final) update to the original question of how to debug tests with the debugging functionality within the VS Code plugin for Julia:

First, as described in the previous post, let’s modify our tests so that the code lives within functions.

included_tests.jl

using Test
using PackageToTest.ModuleToTest

function test_do_something()
    @test ModuleToTest.do_something(41) == 42
end

@testset "test_do_something" begin
    test_do_something()
end

function test_internal_only()
    @test ModuleToTest.internal_only(41) == 42
end

@testset "test_internal_only" begin
    test_internal_only()
end

and we need a debug launch config that runs the active file (I think this is the default config):

launch.jl

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "julia",
            "request": "launch",
            "name": "Run active file",
            "program": "${file}",
            "stopOnEntry": false,
            "cwd": "projectdir/",
            "juliaEnv": "${command:activeJuliaEnvironment}",
            "args": []
        },
    ]
}

Now we can open file included_tests.jl, hit F5 and the debugger will stop at breakpoints in file ModuleToTest.jl and display the values of variables in the debug pane, as well as allowing for the stepping functions to work as expected.