Skip to content

Commit

Permalink
tests: make sure we have external nio when running tests
Browse files Browse the repository at this point in the history
nvim-neotest requires external plugin nvim-nio to run. This was added as a
breaking change in nvim-neotest/neotest#337
  • Loading branch information
zidhuss committed Apr 1, 2024
1 parent 1b6a43a commit 4048a90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
NEOTEST_DIR = misc/neotest
NIO_DIR = misc/nio
PLENARY_DIR = misc/plenary
TREESITTER_DIR = misc/treesitter
TEST_DIR = tests/unit

test: test_core test_rspec

test_core: $(NEOTEST_DIR) $(PLENARY_DIR) $(TREESITTER_DIR)
test_core: $(NEOTEST_DIR) $(NIO_DIR) $(PLENARY_DIR) $(TREESITTER_DIR)
nvim --headless --clean \
-u tests/minimal_init.lua \
-c "PlenaryBustedDirectory $(TEST_DIR)/core { minimal_init = 'tests/minimal_init.lua' }"

test_rspec: $(NEOTEST_DIR) $(PLENARY_DIR) $(TREESITTER_DIR)
test_rspec: $(NEOTEST_DIR) $(NIO_DIR) $(PLENARY_DIR) $(TREESITTER_DIR)
nvim --headless --clean \
-u tests/minimal_init.lua \
-c "PlenaryBustedDirectory $(TEST_DIR)/rspec { minimal_init = 'tests/minimal_init.lua' }"
Expand All @@ -19,6 +20,10 @@ $(NEOTEST_DIR):
git clone --depth=1 --no-single-branch https://github.com/nvim-neotest/neotest $(NEOTEST_DIR)
@rm -rf $(NEOTEST_DIR)/.git

$(NIO_DIR):
git clone --depth=1 --no-single-branch https://github.com/nvim-neotest/nvim-nio $(NIO_DIR)
@rm -rf $(NIO_DIR)/.git

$(PLENARY_DIR):
git clone --depth=1 --branch v0.1.3 https://github.com/nvim-lua/plenary.nvim $(PLENARY_DIR)
@rm -rf $(PLENARY_DIR)/.git
Expand Down
1 change: 1 addition & 0 deletions tests/minimal_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ vim.bo.swapfile = false

vim.cmd([[set runtimepath+=.]])
vim.cmd([[set runtimepath+=./misc/neotest]])
vim.cmd([[set runtimepath+=./misc/nio]])
vim.cmd([[set runtimepath+=./misc/plenary]])
vim.cmd([[set runtimepath+=./misc/treesitter]])

Expand Down

0 comments on commit 4048a90

Please sign in to comment.