mirror of
https://github.com/neovim/neovim.git
synced 2025-12-06 06:32:33 +00:00
test: give more time for nodejs
Link neovim package to project root directory. Increase delay to 3 seconds. Reduce the total lines in temporary node scripts.
This commit is contained in:
@@ -77,6 +77,7 @@ where.exe neovim-ruby-host.bat ; exitIfFailed
|
|||||||
|
|
||||||
cmd /c npm.cmd install -g neovim ; exitIfFailed
|
cmd /c npm.cmd install -g neovim ; exitIfFailed
|
||||||
where.exe neovim-node-host.cmd ; exitIfFailed
|
where.exe neovim-node-host.cmd ; exitIfFailed
|
||||||
|
cmd /c npm link neovim
|
||||||
|
|
||||||
function convertToCmakeArgs($vars) {
|
function convertToCmakeArgs($vars) {
|
||||||
return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" }
|
return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" }
|
||||||
|
|||||||
@@ -33,3 +33,4 @@ fi
|
|||||||
|
|
||||||
echo "Install neovim npm package"
|
echo "Install neovim npm package"
|
||||||
npm install -g neovim
|
npm install -g neovim
|
||||||
|
npm link neovim
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ end
|
|||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
clear()
|
clear()
|
||||||
command([[let $NODE_PATH = get(split(system('npm root -g'), "\n"), 0, '')]])
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('nodejs host', function()
|
describe('nodejs host', function()
|
||||||
@@ -28,21 +27,18 @@ describe('nodejs host', function()
|
|||||||
it('works', function()
|
it('works', function()
|
||||||
local fname = 'Xtest-nodejs-hello.js'
|
local fname = 'Xtest-nodejs-hello.js'
|
||||||
write_file(fname, [[
|
write_file(fname, [[
|
||||||
const socket = process.env.NVIM_LISTEN_ADDRESS;
|
|
||||||
const neovim = require('neovim');
|
const neovim = require('neovim');
|
||||||
const nvim = neovim.attach({socket: socket});
|
const nvim = neovim.attach({socket: process.env.NVIM_LISTEN_ADDRESS});
|
||||||
nvim.command('let g:job_out = "hello"');
|
nvim.command('let g:job_out = "hello"');
|
||||||
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, 2000, function() eq('hello', eval('g:job_out')) end)
|
retry(nil, 3000, 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'
|
||||||
write_file(fname, [[
|
write_file(fname, [[
|
||||||
const socket = process.env.NVIM_LISTEN_ADDRESS;
|
|
||||||
const neovim = require('neovim');
|
const neovim = require('neovim');
|
||||||
const nvim = neovim.attach({socket: socket});
|
const nvim = neovim.attach({socket: process.env.NVIM_LISTEN_ADDRESS});
|
||||||
|
|
||||||
class TestPlugin {
|
class TestPlugin {
|
||||||
hello() {
|
hello() {
|
||||||
@@ -54,6 +50,6 @@ describe('nodejs host', function()
|
|||||||
plugin.instance.hello();
|
plugin.instance.hello();
|
||||||
]])
|
]])
|
||||||
command('let g:job_id = jobstart(["node", "'..fname..'"])')
|
command('let g:job_id = jobstart(["node", "'..fname..'"])')
|
||||||
retry(nil, 2000, function() eq('hello-plugin', eval('g:job_out')) end)
|
retry(nil, 3000, function() eq('hello-plugin', eval('g:job_out')) end)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user