Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hobord/gotest.nvim
https://github.com/hobord/gotest.nvim
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/hobord/gotest.nvim
- Owner: hobord
- Created: 2023-07-14T14:28:12.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-15T07:53:26.000Z (over 1 year ago)
- Last Synced: 2023-07-15T08:56:16.605Z (over 1 year ago)
- Language: Lua
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gotest
## features
- Run go test ./... in the current opened file package directory
- Show latest results of the test
- Run got test with specific test function according to the current cursor
position
- Run the latest test again ignoring to the current position the cursor/file
- Generate untit test for the current function using gotests cmd## install, dependencies
install gotests
```
go get -u github.com/cweill/gotests/...
```load module
```
use {
'hobord/gotest.nvim',
requires = {
'nvim-lua/plenary.nvim',
'nvim-treesitter/nvim-treesitter',
'nvim-lua/popup.nvim',
},
}
```## commands
`GenerateGoTest` generates unit test for the curent function
```
map("n", "rt", function() require('gotest').run_test() end, { noremap = true, silent = true, nowait = true, desc="Run test" })
map("n", "r[", function() require('gotest').clean_last_run() end, { noremap = true, silent = true, nowait = true, desc="CleanLastRun" })
map("n", "re", function() require('gotest').show_last_test_result() end, { noremap = true, silent = true, nowait = true, desc="Show test result" })
```