http toString will raise error if response cannot be converted to string

This commit is contained in:
Vladimir Enchev
2015-11-12 13:49:47 +02:00
parent 1757eb7092
commit 7f968246e8
2 changed files with 8 additions and 2 deletions

View File

@@ -53,7 +53,7 @@ export var test_getString_fail = function (done) {
export var test_getString_fail_when_result_is_not_string = function (done) {
var result;
http.getJSON({ url: "https://httpbin.org/image/png", method: "GET" }).catch(function (e) {
http.getString({ url: "https://httpbin.org/image/png", method: "GET" }).catch(function (e) {
result = e;
try {
TKUnit.assert(result instanceof Error, "Result from getString().catch() should be Error! Current type is " + typeof result);