Skip to content

Instantly share code, notes, and snippets.

@petros
Forked from whazzmaster/keybindings.json
Created August 11, 2022 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petros/edbe8d1654e26270b3eb1d06bded02ce to your computer and use it in GitHub Desktop.
Save petros/edbe8d1654e26270b3eb1d06bded02ce to your computer and use it in GitHub Desktop.
Test tasks for Visual Studio Code and Elixir
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "cmd+t cmd+t",
"command": "workbench.action.tasks.runTask",
"args": "Run All Tests"
},
{
"key": "f5",
"command": "workbench.action.tasks.runTask",
"args": "Run Focused Test"
},
{
"key": "f4",
"command": "workbench.action.tasks.runTask",
"args": "Set Focused Test"
},
{
"key": "f6",
"command": "workbench.action.tasks.runTask",
"args": "Debug Focused Test"
},
{
"key": "cmd+t cmd+f",
"command": "workbench.action.tasks.runTask",
"args": "Test Current File"
}
]
{
"version": "2.0.0",
"tasks": [{
"label": "Build",
"command": "mix",
"group": "build",
"args": [
"compile"
],
"problemMatcher": [
"$mixCompileError",
"$mixCompileWarning"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
}
},
{
"label": "Run All Tests",
"command": "mix test",
"type": "shell",
"group": "test",
"problemMatcher": [
"$mixCompileError",
"$mixCompileWarning",
"$mixTestFailure"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
}
},
{
"label": "Set Focused Test",
"group": "test",
"type": "shell",
"command": "echo -n ${relativeFile}:${lineNumber} > ${workspaceRoot}/.vscode/TEST_FOCUS",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
}
},
{
"label": "Clear Focused Test",
"group": "test",
"type": "shell",
"command": "rm ${workspaceRoot}/.vscode/TEST_FOCUS",
"presentation": {
"echo": true,
"reveal": "never",
"focus": false,
"panel": "shared"
}
},
{
"label": "Run Focused Test",
"command": "mix test $(cat ${workspaceRoot}/.vscode/TEST_FOCUS)",
"type": "shell",
"group": "test",
"problemMatcher": [
"$mixCompileError",
"$mixCompileWarning",
"$mixTestFailure"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
}
},
{
"label": "Debug Focused Test",
"command": "iex -S mix test $(cat ${workspaceRoot}/.vscode/TEST_FOCUS)",
"type": "shell",
"group": "test",
"problemMatcher": [
"$mixCompileError",
"$mixCompileWarning",
"$mixTestFailure"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "new"
}
},
{
"label": "Test Current File",
"command": "mix test ${relativeFile}",
"group": "test",
"type": "shell",
"problemMatcher": [
"$mixCompileError",
"$mixCompileWarning",
"$mixTestFailure"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment