Software /
code /
prosody
Comparison
spec/util_promise_spec.lua @ 11951:6d9e3f541830
util.promise: Fix test
Could not reproduce locally but it complained in CI that
> spec/util_promise_spec.lua:676: Cannot spy on type 'nil', only on functions or callable elements
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 26 Nov 2021 22:38:07 +0100 |
parent | 11947:073e53b72792 |
child | 12749:eb9814372c54 |
comparison
equal
deleted
inserted
replaced
11950:d2a9e95fd27b | 11951:6d9e3f541830 |
---|---|
671 describe("set_nexttick()", function () | 671 describe("set_nexttick()", function () |
672 it("works", function () | 672 it("works", function () |
673 local next_tick = spy.new(function (f) | 673 local next_tick = spy.new(function (f) |
674 f(); | 674 f(); |
675 end) | 675 end) |
676 local cb = spy.new(); | 676 local cb = spy.new(function () end); |
677 promise.set_nexttick(next_tick); | 677 promise.set_nexttick(next_tick); |
678 promise.new(function (y, _) | 678 promise.new(function (y, _) |
679 y("okay"); | 679 y("okay"); |
680 end):next(cb); | 680 end):next(cb); |
681 assert.spy(next_tick).was.called(); | 681 assert.spy(next_tick).was.called(); |