/only.nvim

Filtering plenary.nvim tests. Run ONLY the tests you want.

Primary LanguageLuaMIT LicenseMIT

only.nvim

Build Status License Stars

Filtering plenary.nvim tests. Run ONLY the tests you want.

FeaturesInstallCommandsExamples

Note

The project is still in development and can change.

Features

It's easy to run isolated tests in the current open buffer/file:

  • per tags
  • where the current cursor is located

Install

  • packer.nvim:

    use {
      "lima1909/only.nvim",
      requires = { "nvim-lua/plenary.nvim" },
    }
  • lazy.nvim:

    {
      "lima1909/only.nvim",
      dependencies = { "nvim-lua/plenary.nvim" },
    },

    Commands

User command Description
:OnlyBustedFile tags [your tags] run all tests, which contains one of the tags in the description
:OnlyBustedFile at_cursor run all tests, which the cursor contains

Examples

Tags: thisone,other

Command: :OnlyBustedFile tags thisone,other

describe("my group", function()
	it("first test, thisone", function() end)
	it("second test", function() end)
	it("third testi, other", function() end)
end)

Runs first and third test.