From 0caec65ecfb25305cf6bef96e26d8e6e7f0e7c5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Sat, 7 May 2022 18:10:27 +0200 Subject: [PATCH] Update tools for testing lua plugins --- symlinks/config/nvim/after/plugin/testing.lua | 4 ++++ symlinks/config/nvim/plugin/projectionist.lua | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/symlinks/config/nvim/after/plugin/testing.lua b/symlinks/config/nvim/after/plugin/testing.lua index 808c939..35a82bd 100644 --- a/symlinks/config/nvim/after/plugin/testing.lua +++ b/symlinks/config/nvim/after/plugin/testing.lua @@ -17,3 +17,7 @@ vim.keymap.set("n", "tg", ":TestVisit", opts) vim.api.nvim_create_user_command("PlenaryTestFile", function() require("plenary.test_harness").test_directory(vim.fn.expand("%:p")) end, {}) + +vim.api.nvim_create_user_command("PlenaryTestFileWithLocalMinInit", function() + require("plenary.test_harness").test_directory(vim.fn.expand("%:p"), { minimal_init = "tests/minimal.vim" }) +end, {}) diff --git a/symlinks/config/nvim/plugin/projectionist.lua b/symlinks/config/nvim/plugin/projectionist.lua index ab9791f..aee37bd 100644 --- a/symlinks/config/nvim/plugin/projectionist.lua +++ b/symlinks/config/nvim/plugin/projectionist.lua @@ -272,9 +272,9 @@ local lua_vim_plugin_config = { }, ["lua/*.lua"] = { type = "source", - alternate = "tests/{}.lua", + alternate = "tests/{}_spec.lua", }, - ["tests/*.lua"] = { + ["tests/*_spec.lua"] = { type = "test", alternate = "lua/{}.lua", template = {