Skip to content

Commit

Permalink
fix: remove timeout from default args (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikaverpil authored Jun 25, 2024
1 parent 72b4ffb commit b3821da
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
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

0 comments on commit b3821da

Please sign in to comment.