Files
test-samurai-jest-runner/README.md
M.Schirmer b70d26256c
Some checks failed
tests / test (push) Failing after 4s
create runner with ChatGPT-Codex by using the AGENTS.md
2026-01-03 14:53:56 +01:00

62 lines
1.4 KiB
Markdown

# test-samurai-jest-runner.nvim
Jest.js runner for `test-samurai.nvim`.
Main plugin: https://gitea.mschirmer.com/m13r/test-samurai.nvim
## Features
- Detects Jest test files (`*.test.*`, `*.spec.*`).
- Finds nearest `test`/`it` within `describe` blocks.
- Builds `npx jest` commands for nearest, file, all, and failed-only runs.
- Streams results via a custom Jest reporter using `onTestCaseResult`.
- Uses `--testLocationInResults` for Quickfix and `<leader>o` support.
## Installation (lazy.nvim)
```lua
{
"m13r/test-samurai.nvim",
dependencies = {
"m13r/test-samurai-jest-runner.nvim",
},
config = function()
require("test-samurai").setup({
runners = {
require("test-samurai-jest-runner"),
},
})
end,
}
```
## Local Development (lazy.nvim)
```lua
{
"m13r/test-samurai.nvim",
dependencies = {
{
"test-samurai-jest-runner.nvim",
dir = "/absolute/path/to/test-samurai-jest-runner.nvim",
},
},
config = function()
require("test-samurai").setup({
runners = {
require("test-samurai-jest-runner"),
},
})
end,
}
```
## Usage
Use the standard `test-samurai.nvim` commands (e.g. `TSamNearest`, `TSamFile`, `TSamAll`, `TSamFailedOnly`).
## Notes
- The reporter lives at `reporter/test_samurai_jest_reporter.js` and is loaded via `--reporters`.
- Test names are reported as `Describe/It` for grouping in the listing.