aboutsummaryrefslogtreecommitdiffstats
path: root/tests/core/async/async_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/core/async/async_spec.lua')
-rw-r--r--tests/core/async/async_spec.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/core/async/async_spec.lua b/tests/core/async/async_spec.lua
index 0e881c8b..3eacd145 100644
--- a/tests/core/async/async_spec.lua
+++ b/tests/core/async/async_spec.lua
@@ -120,4 +120,13 @@ describe("async", function()
assert.spy(fn).was_called_with(nil, 2, nil, 4, nil, nil, 7, match.is_function())
end)
)
+
+ it("should not accept yielding non-promise values", function()
+ local err = assert.has_error(function()
+ a.run_blocking(function()
+ coroutine.yield(1)
+ end)
+ end)
+ assert.equals("Expected Promise to have been yielded in async coroutine.", err)
+ end)
end)