# Test Explorer UI VSCode

**URL:** <https://forum.elixirforum.com/t/test-explorer-ui-vscode/32302>\
**Category:** Discussions\
**Tags:** testing, vscode\
**Created:** [June 12, 2020, 9:42am UTC](https://forum.elixirforum.com/t/test-explorer-ui-vscode/32302 "2020-06-12T09:42:20Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![cj5](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cj5/32/21890_2.png) [@cj5](https://forum.elixirforum.com/u/cj5)\
**Post date:** [February 18, 2021, 8:17am UTC](https://forum.elixirforum.com/t/test-explorer-ui-vscode/32302/5 "2021-02-18T08:17:02Z")

</div>

While it would be nice to have a UI, for those who are looking for an integrated testing environment, it is possible to create tasks to run the tests inside VSCode console.

Here is how I do it. Create tasks.json inside .vscode directory

```elixir
{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Run test current file",
      "type": "shell",
      "command": "mix",
      "args": [
        "test",
        "${relativeFile}"
      ],
      "presentation": {
        "echo": true,
        "reveal": "always",
        "focus": true,
        "panel": "new"
      }
    },
    {
      "label": "Run test current line",
      "type": "shell",
      "command": "mix",
      "args": [
        "test",
        "${relativeFile}:${lineNumber}"
      ],
      "presentation": {
        "echo": true,
        "reveal": "always",
        "focus": true,
        "panel": "new"
      }
    },
    {
      "label": "Run all tests",
      "type": "shell",
      "command": "mix",
      "args": [
        "test"
      ],
      "presentation": {
        "echo": true,
        "reveal": "always",
        "focus": true,
        "panel": "new"
      }
    },
    {
      "label": "Lint",
      "type": "shell",
      "command": "mix credo",
      "presentation": {
        "echo": true,
        "reveal": "always",
        "focus": true,
        "panel": "new"
      }
    }
  ]
}

```

And then create keybindings (by using a keybindings.json file inside .vscode or configure globally inside VSCode).

```elixir
[
  {
    "key": "ctrl+i",
    "command": "workbench.action.tasks.runTask",
    "args": "Run test current file"
  },
  {
    "key": "ctrl+u",
    "command": "workbench.action.tasks.runTask",
    "args": "Run test current line"
  },
  {
    "key": "ctrl+t",
    "command": "workbench.action.tasks.runTask",
    "args": "Run all tests"
  },
  {
    "key": "ctrl+l",
    "command": "workbench.action.tasks.runTask",
    "args": "Lint"
  }
]

```

---

_[View the full topic](https://forum.elixirforum.com/t/test-explorer-ui-vscode/32302)._
