Long story short — I'm trying to switch from vim to vscode.
I like TDD and run single or all specs lots of times. That way one of the things I love in vim — instant test feedback with vim-test.
Switching to vscode I discovered how to implement that using user tasks.
So, open Tasks: Open User Tasks
with the command palette and paste your test tasks. I use these ones:
{
"version": "2.0.0",
"tasks": [
{
"label": "Test current file",
"type": "shell",
"command": "bundle exec rspec ${relativeFile}",
"group": "test",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true
}
},
{
"label": "Test current line",
"type": "shell",
"command": "bundle exec rspec ${relativeFile}:${lineNumber}",
"group": "test",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true
}
}
]
}
Also for quick running, I set up hotkeys with vim extension:
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<leader>", "t"],
"commands": [
{
"command": "workbench.action.tasks.runTask",
"args": "Test current file"
}
]
},
{
"before": ["<leader>", "s"],
"commands": [
{
"command": "workbench.action.tasks.runTask",
"args": "Test current line"
}
]
}
],
Top comments (0)