Skip to content

Plugins, Busted and separate Neovim processes? #27000

Answered by HiPhish
HiPhish asked this question in Q&A
Discussion options

You must be logged in to vote

I have found a solution, and it's actually quite obvious in hindsight. The key insight is that I do not need to run the tests in separate processes, but that I need to run the code I want to test in separate processes. Basically:

  • Start an embedded headless Neovim process inside the test
  • Manipulate and probe that process through MsgPack RPC from within the test
  • If I want some value to compare I have to read it out of the process into a variable inside my test
  • When done terminate the process

Here is an example:

local jobopts = {
	rpc = true,
	width = 80,
	height = 24,
}

describe('Process isolation', function()
	-- This will be the channel for each test
	local nvim

	before_each(function(…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by HiPhish
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant