Skip to content

Commit

Permalink
Load nvim-treesitter in CI before running tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cshuaimin committed Oct 13, 2023
1 parent 35b280e commit a9219c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
git clone --depth 1 https://github.com/nvim-treesitter/nvim-treesitter.git ~/.local/share/nvim/site/pack/vendor/start/nvim-treesitter
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
ln -s $(pwd) ~/.local/share/nvim/site/pack/vendor/start
nvim --headless -c "lua require('nvim-treesitter').setup {}" -c 'TSInstallSync python javascript lua rust go' -c 'q'
nvim --headless -c 'TSInstallSync python javascript lua rust go' -c 'q'
- name: Run tests
run: |
Expand Down
4 changes: 4 additions & 0 deletions tests/ssr_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ local a = vim.api
]]

describe("", function()
-- Plenary runs nvim with `--noplugin` argument.
-- Make sure nvim-treesitter is loaded, which populates vim.treesitter's ft_to_lang table.
require "nvim-treesitter"

for _, s in ipairs(tests) do
local ft, desc, content, pattern, template, expected =
s:match "^ (%a-) (.-)\n(.-)%s?====%s?(.-)%s?==>>%s?(.-)%s?====%s?(.-)%s?$"
Expand Down

0 comments on commit a9219c0

Please sign in to comment.