chore: plenary tests POC: add make entry, specify tests
This commit is contained in:
parent
f9dc294829
commit
63cd226c3e
13
Makefile
13
Makefile
@ -43,6 +43,19 @@ help-update:
|
|||||||
help-check: help-update
|
help-check: help-update
|
||||||
git diff --exit-code doc/nvim-tree-lua.txt
|
git diff --exit-code doc/nvim-tree-lua.txt
|
||||||
|
|
||||||
|
#
|
||||||
|
# test
|
||||||
|
#
|
||||||
|
test: plenary.nvim
|
||||||
|
scripts/test.sh $$TEST_NAME
|
||||||
|
|
||||||
|
#
|
||||||
|
# Dependencies
|
||||||
|
#
|
||||||
|
# no plenary tags or releases available
|
||||||
|
plenary.nvim:
|
||||||
|
git clone git@github.com:nvim-lua/plenary.nvim.git
|
||||||
|
|
||||||
|
|
||||||
.PHONY: all lint style check luacheck style-check style-doc luals style-fix help-update help-check
|
.PHONY: all lint style check luacheck style-check style-doc luals style-fix help-update help-check
|
||||||
|
|
||||||
|
|||||||
@ -2,16 +2,19 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# TODO add ability for user to specify a test file or directory
|
|
||||||
|
|
||||||
# TODO clone plenary
|
|
||||||
|
|
||||||
DIR_REPO="$(git rev-parse --show-toplevel)"
|
DIR_REPO="$(git rev-parse --show-toplevel)"
|
||||||
export DIR_REPO
|
export DIR_REPO
|
||||||
|
|
||||||
DIR_PLENARY="${DIR_REPO}/plenary.nvim"
|
DIR_PLENARY="${DIR_REPO}/plenary.nvim"
|
||||||
export DIR_PLENARY
|
export DIR_PLENARY
|
||||||
|
|
||||||
|
if [ "${#}" -eq 1 ]; then
|
||||||
|
TEST_NAME="${1}"
|
||||||
|
else
|
||||||
|
TEST_NAME="tests"
|
||||||
|
fi
|
||||||
|
export TEST_NAME
|
||||||
|
|
||||||
nvim --headless \
|
nvim --headless \
|
||||||
--clean \
|
--clean \
|
||||||
-u "${DIR_REPO}/tests/minimal_init.lua" \
|
-u "${DIR_REPO}/tests/minimal_init.lua" \
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
local test_harness = require('plenary.test_harness')
|
local test_harness = require("plenary.test_harness")
|
||||||
|
|
||||||
local DIR_TEST = vim.env.DIR_REPO .. '/tests'
|
|
||||||
local FILE_MINIMAL_INIT = DIR_TEST .. '/minimal_init.lua'
|
|
||||||
|
|
||||||
test_harness.test_directory(DIR_TEST, { minimal_init = FILE_MINIMAL_INIT })
|
|
||||||
|
|
||||||
|
test_harness.test_directory(
|
||||||
|
vim.env.TEST_NAME,
|
||||||
|
{
|
||||||
|
minimal_init = vim.env.DIR_REPO .. "/tests/minimal_init.lua",
|
||||||
|
sequential = true,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|||||||
@ -18,7 +18,6 @@ describe("utils.path_add_trailing", function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
describe("utils.canonical_path", function()
|
describe("utils.canonical_path", function()
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
stub(vim.fn, "has")
|
stub(vim.fn, "has")
|
||||||
end)
|
end)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user