Refresh generated neovim config
This commit is contained in:
@ -20,7 +20,11 @@ Basic['`string`'] = function()
|
||||
end
|
||||
|
||||
Basic['a metatable'] = function()
|
||||
return setmetatable({}, {})
|
||||
return setmetatable({}, {
|
||||
__tostring = function()
|
||||
return '{}'
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
Basic['a thread'] = function()
|
||||
|
||||
@ -1,5 +1,12 @@
|
||||
local M = {}
|
||||
local promise = require('promise')
|
||||
local reject = promise.reject
|
||||
|
||||
promise.reject = function (reason)
|
||||
local p = reject(reason)
|
||||
p.needHandleRejection = nil
|
||||
return p
|
||||
end
|
||||
|
||||
M.setTimeout = promise.loop.setTimeout
|
||||
|
||||
|
||||
@ -18,12 +18,7 @@ return function(options)
|
||||
if ok then
|
||||
return
|
||||
end
|
||||
-- Some tests never handle the rejected promises, We should ignore them.
|
||||
local msg = tostring(res)
|
||||
if msg:match('^UnhandledPromiseRejection') then
|
||||
return
|
||||
end
|
||||
table.insert(promiseUnhandledError, msg)
|
||||
table.insert(promiseUnhandledError, tostring(res))
|
||||
end
|
||||
return handler
|
||||
end
|
||||
|
||||
@ -69,6 +69,23 @@ describe('EventLoop for Promise.', function()
|
||||
assert.True(wait())
|
||||
end)
|
||||
|
||||
it('call `nextIdle` in `nextIdle` event', function()
|
||||
local onIdle = spy.new(function() end)
|
||||
local onNextIdle = spy.new(function() end)
|
||||
loop.nextIdle(function()
|
||||
onIdle()
|
||||
loop.nextIdle(function()
|
||||
onNextIdle()
|
||||
assert.spy(onNextIdle).was_called()
|
||||
done()
|
||||
end)
|
||||
assert.spy(onIdle).was_called()
|
||||
assert.spy(onNextIdle).was_not_called()
|
||||
end)
|
||||
|
||||
assert.True(wait())
|
||||
end)
|
||||
|
||||
it('override callWrapper method', function()
|
||||
local rawCallWrapper = loop.callWrapper
|
||||
local callback = function() end
|
||||
|
||||
Reference in New Issue
Block a user