Skip to content

Commit

Permalink
feat(typescript): add neotest-jest support (#1189)
Browse files Browse the repository at this point in the history
* feat(typescript): add neotest-jest support

* add missing empty config function

* Update README

---------

Co-authored-by: Micah Halter <[email protected]>
  • Loading branch information
cristobalgvera and mehalter committed Sep 5, 2024
1 parent c5cae1f commit 19a23e9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lua/astrocommunity/pack/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This plugin pack does the following:
- Adds [nvim-vtsls](https://github.com/yioneko/nvim-vtsls) for language specific tooling
- Adds [package-info.nvim](https://github.com/vuki656/package-info.nvim) for project package management
- Adds [nvim-lsp-file-operations](https://github.com/antosha417/nvim-lsp-file-operations) to handles file imports on rename or move within neo-tree
- Adds [neotest-jest](https://github.com/nvim-neotest/neotest-jest) to ease the test running if `neotest` is installed

## How do I disable Eslint format on save?

Expand All @@ -26,3 +27,18 @@ return {
},
}
```

## How do I customize `neotest-jest`?

To customize the `neotest-jest` plugin, you need to configure it like you would with any other plugin

> Learn more about the spec setup used by `lazy` [here](https://lazy.folke.io/spec#spec-setup).
```lua
---@type LazySpec
return {
"nvim-neotest/neotest-jest",
opts = function(_, opts)
-- Add your opts
end,
}
9 changes: 9 additions & 0 deletions lua/astrocommunity/pack/typescript/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,13 @@ return {
},
},
},
{
"nvim-neotest/neotest",
optional = true,
dependencies = { { "nvim-neotest/neotest-jest", config = function() end } },
opts = function(_, opts)
if not opts.adapters then opts.adapters = {} end
table.insert(opts.adapters, require "neotest-jest"(require("astrocore").plugin_opts "neotest-jest"))
end,
},
}

0 comments on commit 19a23e9

Please sign in to comment.