-
-
Save petros/edbe8d1654e26270b3eb1d06bded02ce to your computer and use it in GitHub Desktop.
Test tasks for Visual Studio Code and Elixir
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
// 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" | |
} | |
] |
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
{ | |
"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