diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9bf4a56 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +PLENARY-DIR=../plenary.nvim +PLENARY-REPO=https://github.com/nvim-lua/plenary.nvim.git + +.PHONY: test +test: + nvim --headless --noplugin -u tests/minimal_init.vim -c "lua require('plenary.test_harness').test_directory('tests/', { minimal_init = 'tests/minimal_init.vim', sequential = true, timeout = 120000 })" + +.PHONY: test-file +test-file: + nvim --headless --noplugin -u tests/minimal_init.vim -c "lua require('plenary.busted').run(vim.loop.cwd()..'/'..[[$(FILE)]])" + + +.PHONY: plenary +plenary: + @if [ ! -d $(PLENARY-DIR) ] ;\ + then \ + echo "Cloning plenary.nvim..."; \ + git clone $(PLENARY-REPO) $(PLENARY-DIR); \ + else \ + echo "Updating plenary.nvim..."; \ + git -C $(PLENARY-DIR) pull; \ + fi diff --git a/tests/init_spec.lua b/tests/init_spec.lua new file mode 100644 index 0000000..1b5d614 --- /dev/null +++ b/tests/init_spec.lua @@ -0,0 +1,14 @@ +local fn = vim.fn +local api = vim.api + +local fzf = require("fzf-lua") + +describe("FzfLua", function() + describe("configuration", function() + it("initial setup", function() + fzf.setup({}) + _G.dump(assert.is) + assert.is.truthy(fzf) + end) + end) +end) diff --git a/tests/minimal_init.vim b/tests/minimal_init.vim new file mode 100644 index 0000000..d2e1188 --- /dev/null +++ b/tests/minimal_init.vim @@ -0,0 +1,6 @@ +set hidden +set noswapfile + +set rtp+=../plenary.nvim +set rtp+=../fzf-lua +runtime! plugin/plenary.vim