# VSCode Debugger: Pause on failed test

**URL:** <https://discourse.julialang.org/t/vscode-debugger-pause-on-failed-test/51297>\
**Category:** VS Code\
**Tags:** testing, debug\
**Created:** [December 5, 2020, 12:43pm UTC](https://discourse.julialang.org/t/vscode-debugger-pause-on-failed-test/51297 "2020-12-05T12:43:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ettersi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ettersi/32/6829_2.png) [@ettersi](https://discourse.julialang.org/u/ettersi)\
**Post date:** [December 5, 2020, 12:43pm UTC](https://discourse.julialang.org/t/vscode-debugger-pause-on-failed-test/51297/1 "2020-12-05T12:43:34Z")

</div>

What’s the most convenient way to have the debugger pause upon hitting a failed `@test`?

I assume I could set a breakpoint on some function in the `Test` package, but figuring out (and remembering) which is the appropriate function seems a bit tedious. Is there an easier way?

MWE:

```julia
@test true # Don't pause
@test false # Pause and allow me to investigate why the test failed

```

---

<div class="post-metadata">

**Author:** ![ettersi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ettersi/32/6829_2.png) [@ettersi](https://discourse.julialang.org/u/ettersi)\
**Post date:** [December 5, 2020, 1:09pm UTC](https://discourse.julialang.org/t/vscode-debugger-pause-on-failed-test/51297/2 "2020-12-05T13:09:54Z")

</div>

It seems an easy way to get what I want is to replace `@test` with `@assert` and enable the “All exceptions” option in the Debugger pane.

Alternatively, I imagine it must be possible to set a conditional breakpoint on the `@test` line where I copy-paste the test as the break condition.

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [December 6, 2020, 3:48pm UTC](https://discourse.julialang.org/t/vscode-debugger-pause-on-failed-test/51297/3 "2020-12-06T15:48:01Z")

</div>

You could submit a PR adding more states (& accompanying logic) to `break_on`:  
[https://github.com/JuliaDebug/JuliaInterpreter.jl/blob/8df3bef5991ccb83f8dfdedc76ddc74744b8ca31/src/breakpoints.jl#L328-L347](https://github.com/JuliaDebug/JuliaInterpreter.jl/blob/8df3bef5991ccb83f8dfdedc76ddc74744b8ca31/src/breakpoints.jl#L328-L347)
