(done: (err: Error, res?: string) => void)
| 21 | }; |
| 22 | |
| 23 | export var test_fetch_text = function (done: (err: Error, res?: string) => void) { |
| 24 | // >> fetch-string |
| 25 | fetch('https://http-echo.nativescript.org/get') |
| 26 | .then((response) => response.text()) |
| 27 | .then(function (r) { |
| 28 | // Argument (r) is string! |
| 29 | // >> (hide) |
| 30 | TKUnit.assert(types.isString(r), 'Result from text() should be string! Actual result is: ' + r); |
| 31 | done(null); |
| 32 | // << (hide) |
| 33 | }) |
| 34 | .catch(failOnError(done)); |
| 35 | // << fetch-string |
| 36 | }; |
| 37 | |
| 38 | export var test_fetch_json = function (done: (err: Error, res?: string) => void) { |
| 39 | // >> fetch-json |
nothing calls this directly
no test coverage detected