mirror of
https://github.com/neovim/neovim.git
synced 2025-12-01 14:33:11 +00:00
Merge #8293 from justinmk/test-nodejs
test: nodejs_spec: allow more time for nodejs init
This commit is contained in:
@@ -306,10 +306,7 @@ local function retry(max, max_ms, fn)
|
|||||||
end
|
end
|
||||||
luv.update_time() -- Update cached value of luv.now() (libuv: uv_now()).
|
luv.update_time() -- Update cached value of luv.now() (libuv: uv_now()).
|
||||||
if (max and tries >= max) or (luv.now() - start_time > timeout) then
|
if (max and tries >= max) or (luv.now() - start_time > timeout) then
|
||||||
if type(result) == "string" then
|
error("\nretry() attempts: "..tostring(tries).."\n"..tostring(result))
|
||||||
result = "\nretry() attempts: "..tostring(tries).."\n"..result
|
|
||||||
end
|
|
||||||
error(result)
|
|
||||||
end
|
end
|
||||||
tries = tries + 1
|
tries = tries + 1
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ describe('nodejs host', function()
|
|||||||
nvim.command('call jobstop(g:job_id)');
|
nvim.command('call jobstop(g:job_id)');
|
||||||
]])
|
]])
|
||||||
command('let g:job_id = jobstart(["node", "'..fname..'"])')
|
command('let g:job_id = jobstart(["node", "'..fname..'"])')
|
||||||
retry(nil, 1000, function() eq('hello', eval('g:job_out')) end)
|
retry(nil, 2000, function() eq('hello', eval('g:job_out')) end)
|
||||||
end)
|
end)
|
||||||
it('plugin works', function()
|
it('plugin works', function()
|
||||||
local fname = 'Xtest-nodejs-hello-plugin.js'
|
local fname = 'Xtest-nodejs-hello-plugin.js'
|
||||||
@@ -56,6 +56,6 @@ describe('nodejs host', function()
|
|||||||
nvim.command('call jobstop(g:job_id)');
|
nvim.command('call jobstop(g:job_id)');
|
||||||
]])
|
]])
|
||||||
command('let g:job_id = jobstart(["node", "'..fname..'"])')
|
command('let g:job_id = jobstart(["node", "'..fname..'"])')
|
||||||
retry(nil, 1000, function() eq('hello-plugin', eval('g:job_out')) end)
|
retry(nil, 2000, function() eq('hello-plugin', eval('g:job_out')) end)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user