MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / test_fetch_json

Function test_fetch_json

apps/automated/src/fetch/fetch-tests.ts:38–51  ·  view source on GitHub ↗
(done: (err: Error, res?: string) => void)

Source from the content-addressed store, hash-verified

36};
37
38export var test_fetch_json = function (done: (err: Error, res?: string) => void) {
39 // >> fetch-json
40 fetch('https://http-echo.nativescript.org/get')
41 .then((response) => response.json())
42 .then(function (r) {
43 // Argument (r) is JSON object!
44 // >> (hide)
45 TKUnit.assertNotNull(r, 'Result from json() should be JSON object!');
46 done(null);
47 // << (hide)
48 })
49 .catch(failOnError(done));
50 // << fetch-json
51};
52
53export var test_fetch_formData = function (done: (err: Error, res?: string) => void) {
54 // >> fetch-formdata

Callers

nothing calls this directly

Calls 2

fetchFunction · 0.85
failOnErrorFunction · 0.85

Tested by

no test coverage detected