diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-06-04 19:42:26 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-06-04 19:42:28 -0400 |
commit | f274b84e1e4676e8a499e4ad70f4501d5f4fe305 (patch) | |
tree | b32ae1beded049052612e5f80f6a083361d91a66 /test/functional/provider/nodejs_spec.lua | |
parent | cf92a76285f7bc3823ea45c4ced9085a4fe8e362 (diff) | |
download | rneovim-f274b84e1e4676e8a499e4ad70f4501d5f4fe305.tar.gz rneovim-f274b84e1e4676e8a499e4ad70f4501d5f4fe305.tar.bz2 rneovim-f274b84e1e4676e8a499e4ad70f4501d5f4fe305.zip |
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.
Diffstat (limited to 'test/functional/provider/nodejs_spec.lua')
-rw-r--r-- | test/functional/provider/nodejs_spec.lua | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/test/functional/provider/nodejs_spec.lua b/test/functional/provider/nodejs_spec.lua index f69c3e7c78..07a00f8a8c 100644 --- a/test/functional/provider/nodejs_spec.lua +++ b/test/functional/provider/nodejs_spec.lua @@ -16,7 +16,6 @@ end before_each(function() clear() - command([[let $NODE_PATH = get(split(system('npm root -g'), "\n"), 0, '')]]) end) describe('nodejs host', function() @@ -28,21 +27,18 @@ describe('nodejs host', function() it('works', function() local fname = 'Xtest-nodejs-hello.js' write_file(fname, [[ - const socket = process.env.NVIM_LISTEN_ADDRESS; 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('call jobstop(g:job_id)'); ]]) 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) it('plugin works', function() local fname = 'Xtest-nodejs-hello-plugin.js' write_file(fname, [[ - const socket = process.env.NVIM_LISTEN_ADDRESS; const neovim = require('neovim'); - const nvim = neovim.attach({socket: socket}); + const nvim = neovim.attach({socket: process.env.NVIM_LISTEN_ADDRESS}); class TestPlugin { hello() { @@ -54,6 +50,6 @@ describe('nodejs host', function() plugin.instance.hello(); ]]) 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) |