Skip to content
Oleksii Lisikh edited this page Feb 19, 2026 · 3 revisions

neotest-scala Wiki

Welcome to the neotest-scala documentation.

Quick Links

What This Plugin Does

A Neotest adapter for running Scala tests directly from Neovim.

Features

  • 5 Test Libraries Supported: ScalaTest, munit, specs2, utest, zio-test
  • Treesitter-based Test Discovery: Automatically detects tests in your Scala files
  • Metals Integration: Uses nvim-metals for project metadata and build target detection
  • Debugging Support: Debug tests with nvim-dap integration
  • Flexible Configuration: Custom args, dynamic configuration callbacks

Supported Test Libraries

Library Style Single Test Debug
ScalaTest BDD, FunSuite, FreeSpec ✅ Yes
munit ScalaTest-style ✅ Yes
specs2 Specification-based ✅ Yes
utest Lightweight ❌ No
zio-test ZIO effects ✅ Yes

Quick Example

require("neotest").setup({
  adapters = {
    require("neotest-scala")
  }
})

Then use Neotest commands to run tests:

:Neotest run        " Run nearest test
:Neotest run file   " Run all tests in file
:Neotest summary    " Open test summary

Requirements

Requirement Purpose
Neovim 0.8+ Core editor
neotest Test runner framework
nvim-metals Scala LSP for project metadata
sbt Build tool for running tests
Treesitter Scala Test discovery

See Installation for detailed setup instructions.

Fork Notice

This is a fork of the original neotest-scala by Stevan Milic. Huge thanks for creating and maintaining the original plugin.

Clone this wiki locally