Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove timeout from default args #56

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ return {

## ⚙️ Configuration

| Argument | Default value | Description |
| ------------------------ | ----------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `go_test_args` | `{ "-v", "-race", "-count=1", "-timeout=60s" }` | Arguments to pass into `go test`. |
| `dap_go_enabled` | `false` | Leverage [leoluz/nvim-dap-go](https://github.com/leoluz/nvim-dap-go) for debugging tests. |
| `dap_go_opts` | `{}` | Options to pass into `require("dap-go").setup()`. |
| `warn_test_name_dupes` | `true` | Warn about duplicate test names within the same Go package. |
| `warn_test_not_executed` | `true` | Warn if test was not executed. |
| Argument | Default value | Description |
| ------------------------ | ------------------------------- | ----------------------------------------------------------------------------------------- |
| `go_test_args` | `{ "-v", "-race", "-count=1" }` | Arguments to pass into `go test`. |
| `dap_go_enabled` | `false` | Leverage [leoluz/nvim-dap-go](https://github.com/leoluz/nvim-dap-go) for debugging tests. |
| `dap_go_opts` | `{}` | Options to pass into `require("dap-go").setup()`. |
| `warn_test_name_dupes` | `true` | Warn about duplicate test names within the same Go package. |
| `warn_test_not_executed` | `true` | Warn if test was not executed. |

### Example configuration: custom `go test` arguments

Expand All @@ -111,6 +111,8 @@ local config = { -- Specify configuration
"-race",
"-count=1",
"-timeout=60s",
"-parallel=1",
"-p=2",
"-coverprofile=" .. vim.fn.getcwd() .. "/coverage.out",
},
}
Expand All @@ -125,6 +127,8 @@ Note that the example above writes a coverage file. You can use
[andythigpen/nvim-coverage](https://github.com/andythigpen/nvim-coverage) to
show the coverage in Neovim.

See `go help test` for possible arguments.

### Example configuration: debugging

To debug tests, make sure you depend on
Expand Down
1 change: 0 additions & 1 deletion lua/neotest-golang/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ function Opts:new(opts)
"-v",
"-race",
"-count=1",
"-timeout=60s",
}
self.dap_go_enabled = opts.dap_go_enabled or false
self.dap_go_opts = opts.dap_go_opts or {}
Expand Down
2 changes: 0 additions & 2 deletions tests/unit/options_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ describe("Options are set up", function()
"-v",
"-race",
"-count=1",
"-timeout=60s",
},
warn_test_name_dupes = true,
warn_test_not_executed = true,
Expand All @@ -28,7 +27,6 @@ describe("Options are set up", function()
"-race",
"-count=1",
"-parallel=1", -- non-default
"-timeout=60s",
},
warn_test_name_dupes = true,
warn_test_not_executed = true,
Expand Down
Loading