Skip to content

NachoNievaG/go-tester.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-tester.nvim

Forget about opening tmux or another terminal instance to run your file/package tests.

What is go-tester?

Go tester is a way to avoid the context switching in running a test suite in your golang project.
As soon as you run the command, you can begin to fix all from tests to actual source code, just for the tests to be re-run as soon as you save the files you are coding in.

Imgur

Special thanks

tjdevries who inspired this plugin to be created. For more information about how it works in practical applications watch This Video

Getting started

Required Dependecies

How to install it

Using vim-plug

Plug 'nvim-treesitter/nvim-treesitter'
Plug 'nachonievag/go-tester.nvim'

Using dein

call dein#add('nvim-treesitter/nvim-treesitter')
call dein#add('nachonievag/go-tester.nvim')

Using Packer

use {
  'nachonievag/go-tester.nvim',
  requires = { {'nvim-treesitter/nvim-treesitter'} }
}

Configurations

You can specify the several flags to execute the go test command.
As it is today the defined command to execute is:
go test $exec_path -v -json
This flags are mandatory for the plugin to work, yet you could add the ones you need at will.

use {
  "nachonievag/go-tester.nvim",
  requires = "nvim-treesitter/nvim-treesitter",
  config = function()
    require("go-tester").setup({ flags = { "-failfast", "-race", "-cover" } })
  end
}

In this case, we shall see as the user command is executed, that the command executed is:
go test $exec_path -v -json -failfast -race -cover

Commands

Commands Description
GoTestFileOnSave Test current buffer on save.
GoTestPackageOnSave Test package where current buffer is located.
GoTestLineDiag After having diagnostics executed, show in split the results of a test.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages