From f78ca77dd2e5307cd63035822001284b7dab50b1 Mon Sep 17 00:00:00 2001 From: Amber Grace <93293456+ambers-careware@users.noreply.github.com> Date: Wed, 26 Oct 2022 12:20:39 -0600 Subject: [PATCH] Improve expect output in edge case --- lib/init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/init.lua b/lib/init.lua index 97cdf37..00baf5a 100644 --- a/lib/init.lua +++ b/lib/init.lua @@ -1669,7 +1669,13 @@ end local function expectHelper(status, ...) if status ~= Promise.Status.Resolved then - error((...) == nil and "Expected Promise rejected with no value." or (...), 3) + local message = (...) + error( + if (message == nil) or (message == "") + then "Expected Promise rejected with no value." + else message, + 3 + ) end return ...