Skip to content

Instantly share code, notes, and snippets.

@aabs
Forked from whazzmaster/keybindings.json
Created January 24, 2018 03:58
Show Gist options
  • Save aabs/5cd912290815fd841bb1664f8a9e372f to your computer and use it in GitHub Desktop.
Save aabs/5cd912290815fd841bb1664f8a9e372f 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": [{
"taskName": "Build",
"command": "mix",
"group": "build",
"args": [
"compile"
],
"problemMatcher": [
"$mixCompileError",
"$mixCompileWarning"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
}
},
{
"taskName": "Run All Tests",
"command": "mix test",
"type": "shell",
"group": "test",
"problemMatcher": [
"$mixCompileError",
"$mixCompileWarning",
"$mixTestFailure"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
}
},
{
"taskName": "Set Focused Test",
"group": "test",
"type": "shell",
"command": "echo -n ${relativeFile} > ${workspaceRoot}/.vscode/TEST_FOCUS",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
}
},
{
"taskName": "Clear Focused Test",
"group": "test",
"type": "shell",
"command": "rm ${workspaceRoot}/.vscode/TEST_FOCUS",
"presentation": {
"echo": true,
"reveal": "never",
"focus": false,
"panel": "shared"
}
},
{
"taskName": "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"
}
},
{
"taskName": "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"
}
},
{
"taskName": "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