mirror of
https://github.com/AmberGraceRblx/luau-promise.git
synced 2025-04-24 15:50:01 +00:00
Improve expect output in edge case
This commit is contained in:
parent
2c6f433903
commit
f78ca77dd2
1 changed files with 7 additions and 1 deletions
|
@ -1669,7 +1669,13 @@ end
|
||||||
|
|
||||||
local function expectHelper(status, ...)
|
local function expectHelper(status, ...)
|
||||||
if status ~= Promise.Status.Resolved then
|
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
|
end
|
||||||
|
|
||||||
return ...
|
return ...
|
||||||
|
|
Loading…
Reference in a new issue