Skip to content

Commit

Permalink
tests: update test file
Browse files Browse the repository at this point in the history
  • Loading branch information
olimorris committed Nov 30, 2024
1 parent 4795ec0 commit 1848048
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ format:
test: $(PLENARY_DIR) $(TREESITTER_DIR)
@echo "===> Testing:"
nvim --headless --clean \
-u scripts/minimal.vim \
-c "PlenaryBustedDirectory lua/spec/codecompanion { minimal_init = 'scripts/minimal.vim' }"
-u scripts/minimal.lua \
-c "PlenaryBustedDirectory lua/spec/codecompanion { minimal_init = 'scripts/minimal.lua' }"

$(PLENARY_DIR):
git clone --depth=1 $(PLENARY_URL) $(PLENARY_DIR)
Expand Down
18 changes: 18 additions & 0 deletions scripts/minimal.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
vim.cmd([[let &rtp.=','.getcwd()]])

vim.cmd("set rtp+=./deps/plenary")
vim.cmd("set rtp+=./deps/treesitter")

local required_parsers = { "lua", "markdown", "markdown_inline", "yaml" }
local installed_parsers = require("nvim-treesitter.info").installed_parsers()
local to_install = vim.tbl_filter(function(parser)
return not vim.tbl_contains(installed_parsers, parser)
end, required_parsers)

if #to_install > 0 then
-- fixes 'pos_delta >= 0' error - https://github.com/nvim-lua/plenary.nvim/issues/52
vim.cmd("set display=lastline")
-- make "TSInstall*" available
vim.cmd("runtime! plugin/nvim-treesitter.vim")
vim.cmd("TSInstallSync " .. table.concat(to_install, " "))
end
23 changes: 0 additions & 23 deletions scripts/minimal.vim

This file was deleted.

0 comments on commit 1848048

Please sign in to comment.