From 89abfcd2fbd56c3246772726a85ed0e548d77d3b Mon Sep 17 00:00:00 2001 From: William Boman Date: Mon, 11 Apr 2022 01:04:06 +0200 Subject: make install context available via coroutine context (#586) --- tests/core/async/async_spec.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/core/async/async_spec.lua') 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)