Skip to content

Instantly share code, notes, and snippets.

@PJUllrich
Created December 20, 2021 13:20
Show Gist options
  • Save PJUllrich/0ed3eaf81790e6c902a57fc30a857f4a to your computer and use it in GitHub Desktop.
Save PJUllrich/0ed3eaf81790e6c902a57fc30a857f4a to your computer and use it in GitHub Desktop.
VSCode Tasks for running Elixir tests quickly
{
"version": "2.0.0",
"tasks": [
{
"label": "Build",
"type": "shell",
"command": "mix compile",
"problemMatcher": ["$mixCompileError", "$mixCompileWarning"],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Format Current File",
"type": "shell",
"command": "mix",
"args": ["format", "${relativeFile}"],
"options": {
"cwd": "${workspaceRoot}"
},
"problemMatcher": "$mixTestFailure",
"presentation": {
"focus": false,
"reveal": "never"
}
},
{
"label": "Run All Tests",
"type": "shell",
"command": "mix",
"args": ["test"],
"options": {
"cwd": "${workspaceRoot}"
},
"problemMatcher": [
"$mixCompileError",
"$mixCompileWarning",
"$mixTestFailure"
],
"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"focus": true
}
},
{
"label": "Run Current Tests",
"type": "shell",
"command": "mix",
"args": ["test", "${relativeFile}"],
"options": {
"cwd": "${workspaceRoot}"
},
"problemMatcher": [
"$mixCompileError",
"$mixCompileWarning",
"$mixTestFailure"
],
"presentation": {
"focus": true
}
},
{
"label": "Run Focused Test",
"type": "shell",
"command": "mix",
"args": ["test", "${relativeFile}:${lineNumber}"],
"options": {
"cwd": "${workspaceRoot}"
},
"problemMatcher": [
"$mixCompileError",
"$mixCompileWarning",
"$mixTestFailure"
],
"presentation": {
"focus": true
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment