Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

theutz/neotest-pest

Repository files navigation

neotest-pest

Caution

This package has been archived and will receive no more updates. Please consider switching to V13Axel/neotest-pest.

Tests

This plugin provides a Pest adapter for the Neotest framework.

⚠️ This plugin is still in the early stages of development. Please test against your Pest tests ⚠️

📦 Installation

Install the plugin using packer:

use({
  'nvim-neotest/neotest',
  requires = {
    ...,
    'theutz/neotest-pest',
  },
  config = function()
    require('neotest').setup({
      ...,
      adapters = {
        require('neotest-pest'),
      }
    })
  end
})

🔧 Configuration

The plugin may be configured as below:

adapters = {
  require('neotest-pest')({
    pest_cmd = function()
      return "vendor/bin/pest"
    end
  }),
}

🚀 Usage

Test single method

To test a single test, hover over the test and run lua require('neotest').run.run()

Test file

To test a file run lua require('neotest').run.run(vim.fn.expand('%'))

Test directory

To test a directory run lua require('neotest').run.run("path/to/directory")

Test suite

To test the full test suite run lua require('neotest').run.run({ suite = true })

🎁 Contributing

This project is maintained by the Neovim PHP community. Please raise a PR if you are interested in adding new functionality or fixing any bugs. When submitting a bug, please include an example test that we can test against.

To trigger the tests for the adapter, run:

./scripts/test

👏 Prior Art

This package is insanely reliant on the excellent efforts put into olimorris/neotest-phpunit by @olimorris.