diff --git a/tests/net/request/util.luau b/tests/net/request/util.luau index e099d93..562b650 100644 --- a/tests/net/request/util.luau +++ b/tests/net/request/util.luau @@ -1,19 +1,23 @@ local util = {} -function util.pass(method, url, message: string) +function util.pass(method, url, message) local response = net.request({ method = method, url = url, }) - assert(response.ok, message) + if not response.ok then + error(string.format("%s failed!\nResponse: %s", message, stdio.format(response))) + end end -function util.fail(method, url, message: string) +function util.fail(method, url, message) local response = net.request({ method = method, url = url, }) - assert(not response.ok, message) + if not response.ok then + error(string.format("%s passed!\nResponse: %s", message, stdio.format(response))) + end end return util