all repos

init.lua @ b8ff569

my nvim config

init.lua/lua/plugins/neotest.lua(view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---@type LazySpec
return {
  "nvim-neotest/neotest",
  keys = function()
    -- stylua: ignore
    return {
      { "<leader>tn", function() require("neotest").run.run() end },
      { "<leader>tt", function() require("neotest").run.run(vim.fn.expand "%") end },
      { "<leader>tS", function() require("neotest").run.stop() end },
      { "<leader>to", function() require("neotest").output.open() end },
      { "<leader>ts", function() require("neotest").summary.toggle() end },
      { "<leader>tw", function() require("neotest").watch.toggle() end },
      { "]t", function() require("neotest").jump.next() end },
      { "[t", function() require("neotest").jump.prev() end },
      { "]T", function() require("neotest").jump.next { status = "failed" } end },
      { "[T", function() require("neotest").jump.prev { status = "failed" } end },
    }
  end,
  dependencies = {
    "nvim-neotest/nvim-nio",
    "fredrikaverpil/neotest-golang",
    "nvim-neotest/neotest-plenary",
    "nvim-treesitter",
  },
  config = function()
    vim.diagnostic.config({
      virtual_text = {
        format = function(diagnostic)
          local r, _ = diagnostic.message
            :gsub("\n", " ")
            :gsub("\t", " ")
            :gsub("%s+", " ")
            :gsub("^%s+", "")
          return r
        end,
      },
    }, vim.api.nvim_create_namespace "neotest")

    ---@type neotest.Config
    ---@diagnostic disable-next-line: missing-fields
    require("neotest").setup {
      adapters = {
        require "neotest-plenary",
        require "neotest-golang" {
          go_test_args = { "-count=1", "-timeout=60s" },
          testify_enabled = true,
        },
      },
      discovery = {
        enabled = true,
        concurrent = 0,
      },
      running = { concurrent = true },
      icons = {
        expanded = "",
        child_prefix = "",
        child_indent = "",
        final_child_prefix = "",
        non_collapsible = "",
        collapsed = "",
        passed = "",
        running = "",
        failed = "",
        unknown = "",
      },
      ---@diagnostic disable-next-line: missing-fields
      summary = {
        animated = false,
        ---@diagnostic disable-next-line: missing-fields
        mappings = {
          expand = { "l", "h", "<CR>" },
          stop = "s",
        },
      },
    }
  end,
}