Compare commits
2 Commits
a13d616da5
...
72a2e84fd4
Author | SHA1 | Date | |
---|---|---|---|
72a2e84fd4
|
|||
585f04c745
|
11
.githooks/pre-commit
Executable file
11
.githooks/pre-commit
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Running tests before commit..."
|
||||
|
||||
# Run your Neovim tests headlessly with Plenary
|
||||
make test || {
|
||||
echo "Tests failed. Commit aborted."
|
||||
exit 1
|
||||
}
|
||||
|
||||
echo "Tests passed. Proceeding with commit."
|
4
Makefile
Normal file
4
Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
test:
|
||||
nvim --headless -c "PlenaryBustedDirectory tests/ {minimal_init = './tests/minit.lua'}"
|
||||
|
||||
.PHONY: test
|
@ -482,6 +482,14 @@ require "dep" {
|
||||
- Lazy loading nvim-cmp doesn't work as the external sources don't get reconized
|
||||
by nvim-cmp when it's loaded.
|
||||
|
||||
## Contributing
|
||||
|
||||
When contributing you may choose to run tests before commiting changes, if that
|
||||
is so you may choose to run the following:
|
||||
```sh
|
||||
git config core.hooksPath .githooks
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
dep is licensed under the [MIT License](LICENSE).
|
||||
|
20
tests/dep_spec.lua
Normal file
20
tests/dep_spec.lua
Normal file
@ -0,0 +1,20 @@
|
||||
---@diagnostic disable: undefined-global, undefined-field
|
||||
local dep_ui_format = require("dep.ui.format")
|
||||
|
||||
describe("ui log formatting", function()
|
||||
it("returns the proper chunks to print a formatted line", function()
|
||||
assert.same(
|
||||
{
|
||||
{ "[", "" },
|
||||
{ "11:22:33", "Boolean" },
|
||||
{ "] ", "" },
|
||||
{ "file.lua", "String" },
|
||||
{ ":", "" },
|
||||
{ "1", "Number" },
|
||||
{ ": ", "" },
|
||||
{ "some fancy message", "" }
|
||||
},
|
||||
dep_ui_format.log_line("[11:22:33] file.lua:1:(vim) some fancy message")
|
||||
)
|
||||
end)
|
||||
end)
|
1
tests/minit.lua
Normal file
1
tests/minit.lua
Normal file
@ -0,0 +1 @@
|
||||
vim.opt.rtp:prepend(".")
|
Reference in New Issue
Block a user