Last active
January 2, 2023 18:19
-
-
Save aifrak/d681499d5e8ebfdcb9e5ac4de5ba6a12 to your computer and use it in GitHub Desktop.
Running tests in VSCode with Elixir and ElixirLS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| // Use IntelliSense to learn about possible attributes. | |
| // Hover to view descriptions of existing attributes. | |
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "type": "mix_task", | |
| "name": "mix test", | |
| "request": "launch", | |
| "task": "test", | |
| "taskArgs": [ | |
| "--include" ,"pending" | |
| ], | |
| "startApps": false, | |
| "projectDir": "${workspaceRoot}${config:elixirLS.projectDir}", | |
| "requireFiles": [ | |
| "test/**/test_helper.exs", | |
| "test/**/*_test.exs" | |
| ] | |
| }, | |
| { | |
| "type": "mix_task", | |
| "name": "mix test (single test)", | |
| "request": "launch", | |
| "task": "test", | |
| "taskArgs": [ | |
| "--only", "test:test ${input:promptTestName}" | |
| ], | |
| "startApps": false, | |
| "projectDir": "${workspaceRoot}${config:elixirLS.projectDir}", | |
| "requireFiles": [ | |
| "test/**/test_helper.exs", | |
| "test/**/*_test.exs" | |
| ] | |
| }, | |
| { | |
| "type": "mix_task", | |
| "name": "mix test current file", | |
| "request": "launch", | |
| "task": "test", | |
| "taskArgs": [ | |
| "${relativeFile}" | |
| ], | |
| "startApps": true, | |
| "projectDir": "${workspaceRoot}", | |
| "requireFiles": [ | |
| "test/**/test_helper.exs", | |
| "${relativeFile}" | |
| ] | |
| }, | |
| // Copied from: https://elixirforum.com/t/running-debugging-tests-in-vscode-with-elixirls/33837/7 | |
| { | |
| "type": "mix_task", | |
| "name": "mix test current line number", | |
| "request": "launch", | |
| "task": "test", | |
| "taskArgs": [ | |
| "${relativeFile}:${lineNumber}" | |
| ], | |
| "startApps": true, | |
| "projectDir": "${workspaceRoot}", | |
| "requireFiles": [ | |
| "test/**/test_helper.exs", | |
| "${relativeFile}" | |
| ] | |
| } | |
| ], | |
| "inputs": [ | |
| { | |
| "id": "promptTestName", | |
| "type": "promptString", | |
| "description": "Name of your test.", | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment