Skip to content

Commit

Permalink
feat: jest task
Browse files Browse the repository at this point in the history
  • Loading branch information
willruggiano committed Oct 1, 2023
1 parent 3d6104f commit 08bcf0f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3'
version: "3"

tasks:
default:
Expand Down
27 changes: 27 additions & 0 deletions plugins/overseer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,33 @@ return function()
},
}

o.register_template {
name = "Run File (jest)",
builder = function()
local file = vim.fn.expand "%"
return {
cwd = vim.fn.expand "%:p:h",
cmd = { "jest" },
args = { file },
strategy = {
"toggleterm",
open_on_start = true,
direction = "horizontal",
on_create = function()
vim.cmd.stopinsert()
end,
},
}
end,
condition = {
filetype = { "typescript" },
callback = function()
local file = vim.fn.expand "%"
return vim.endswith(file, ".test.ts")
end,
},
}

local nnoremaps = require("bombadil.lib.keymap").nnoremaps

nnoremaps {
Expand Down

0 comments on commit 08bcf0f

Please sign in to comment.