Harrygr
I’m trying to set up a nice debugging experience in my pretty bog-standard Phoenix app using VSCode and ElixirLS. Currently it kind of works but there are a number of issues with it:
- The tests run very slowly compared to
mix test(221s vs 7s) - The debugger output is very noisy and interspersed with errors that don’t arise during a normal test run.
- The debugger hangs at the end of the test run and has to be manually stopped
I’m using the default config as generated by ElixirLS:
{
"version": "0.2.0",
"configurations": [
{
"type": "mix_task",
"name": "mix test",
"request": "launch",
"task": "test",
"taskArgs": [
"--trace"
],
"startApps": true,
"projectDir": "${workspaceRoot}",
"requireFiles": [
"test/**/test_helper.exs",
"test/**/*_test.exs"
]
}
]
}
Here’s the output from starting the debugger:
Started ElixirLS debugger v0.5.0
Elixir version: "1.10.3 (compiled with Erlang/OTP 22)"
Erlang version: "23"
ElixirLS compiled with Elixir 1.7.4 and erlang 20
# lots of Bcrypt errors 🤷♂️
I’d also like to be able to only run tests for the current file, or even just the current test. I believe vscode exposes various interpolations for launch configs.
Has anyone managed to get a nice test debugging experience in vscode with Elixir? Are there any changes I can make to fix the above problems.?
Trending in Questions
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m working on a small exercise involving update_in/3, and I came up with this solution:
data = %{
name: "Periodic Table",
category:...
New
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication):
toke...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #metaprogramming
- #hex












Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Ankit_Lathiya
Using Visual Studio Code to debug Jest based unit tests, please follow the below steps.
Setting up configuration
Step 1: Enable debugging in our project.
Step 2: Configuring the ElixirJS test debugging single run.
Step 3: Debugging our project.
Your configuration seems right and I don’t know what version you are using of VSCode but right now the test experience in VSCode with Elixir is good.
Best Regards,
Harrygr
I’m not sure you understood my question. It has nothing to do with Jest or JavaScript. These are Elixir tests that use ExUnit. The steps you mention don’t explain anything either.
axelson
It is expected to be significantly slower since in debugging mode all of the modules in the application need to be instrumented to accept breakpoints.
it’s not too surprising that some test would fail since the previously mentioned debugging delay could cause some
GenServer.call’s to fail due to timeouts. Although I generally wouldn’t expect too many issues from this.This is expected
I’m not sure of a nice way of doing this but you might be able to manually edit the
"task": "test",line to have the line number of the test to run. Something like:"task": "test test/providers/workspace_symbols_test.exs:37",. But as you mention some sort of interpolation should be possible, maybe you can find some ideas this VSCode testing extention: Elixir Test - Visual Studio Marketplacemike_bianco
I’m running into a similar problem. Would love to understand how others are using elixirls and vscode debugger.
bengro
Same here. I want to debug the app whilst running a test.
Could anyone share their configuration or at least describe the best possible debugging experience to date? Which IDE, plugins, etc?
Being new to the ecosystem and being used to a super smooth debugging experience (JVM) I’m feeling overwhelmed and underwhelmed at the same time
peoj
Could you say a bit more as to why please? Is there a way to modify this behaviour?
Here’s an example that works, although the by line test is a bit less convenient since your cursor must be on the precise line of the test you want to run:
Any thoughts on how we might be able to speed this up? Some performance degradation is fine (and I imagine unavoidable) but it’s incredibly slow to use at the moment, and often quicker to add a few
IO.inspectstatements. Perhaps there is a way of specifying only certain modules that we’re interested in instrumenting?lukaszsamson
With VSCode ElixirLS extension it’s now possible to debug test directly from Testing tab or via right clicking the icon next to test definition and selecting Debug test. It will run the debugger with a launch configuration for
mix testtask and fall back to a default one if not found