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

Function test_fetch_arraybuffer

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

Source from the content-addressed store, hash-verified

81};
82
83export var test_fetch_arraybuffer = function (done: (err: Error, res?: string) => void) {
84 // >> fetch-arraybuffer
85 fetch('https://http-echo.nativescript.org/get')
86 .then((response) => response.arrayBuffer())
87 .then(function (r) {
88 // Argument (r) is ArrayBuffer object!
89 // >> (hide)
90 TKUnit.assertNotNull(r, 'Result from arrayBuffer() should be ArrayBuffer object!');
91 done(null);
92 // << (hide)
93 })
94 .catch(failOnError(done));
95 // << fetch-arraybuffer
96};
97
98export var test_fetch_fail_invalid_url = function (done) {
99 var completed: boolean;

Callers

nothing calls this directly

Calls 3

fetchFunction · 0.85
failOnErrorFunction · 0.85
arrayBufferMethod · 0.80

Tested by

no test coverage detected