From f88a7162c507bd212d8ec5cf3b75f64592f11ea1 Mon Sep 17 00:00:00 2001 From: Asger F Date: Mon, 5 Aug 2019 12:22:45 +0100 Subject: [PATCH] JS: Test for fetch --- .../frameworks/ClientRequests/ClientRequests.expected | 3 +++ .../ql/test/library-tests/frameworks/ClientRequests/tst.js | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/javascript/ql/test/library-tests/frameworks/ClientRequests/ClientRequests.expected b/javascript/ql/test/library-tests/frameworks/ClientRequests/ClientRequests.expected index 9870c673ec4..91a1c34d063 100644 --- a/javascript/ql/test/library-tests/frameworks/ClientRequests/ClientRequests.expected +++ b/javascript/ql/test/library-tests/frameworks/ClientRequests/ClientRequests.expected @@ -44,6 +44,7 @@ test_ClientRequest | tst.js:129:5:129:37 | request ... true}) | | tst.js:133:5:133:18 | axios.get(url) | | tst.js:134:5:134:48 | axios.g ... json'}) | +| tst.js:139:5:139:14 | fetch(url) | test_getADataNode | tst.js:53:5:53:23 | axios({data: data}) | tst.js:53:18:53:21 | data | | tst.js:57:5:57:39 | axios.p ... data2}) | tst.js:57:19:57:23 | data1 | @@ -128,6 +129,7 @@ test_getUrl | tst.js:133:5:133:18 | axios.get(url) | tst.js:133:15:133:17 | url | | tst.js:134:5:134:48 | axios.g ... json'}) | tst.js:134:15:134:47 | { url: ... 'json'} | | tst.js:134:5:134:48 | axios.g ... json'}) | tst.js:134:22:134:24 | url | +| tst.js:139:5:139:14 | fetch(url) | tst.js:139:11:139:13 | url | test_getAResponseDataNode | tst.js:19:5:19:23 | requestPromise(url) | tst.js:19:5:19:23 | requestPromise(url) | text | true | | tst.js:21:5:21:23 | superagent.get(url) | tst.js:21:5:21:23 | superagent.get(url) | text | true | @@ -164,3 +166,4 @@ test_getAResponseDataNode | tst.js:129:5:129:37 | request ... true}) | tst.js:129:5:129:37 | request ... true}) | json | true | | tst.js:133:5:133:18 | axios.get(url) | tst.js:133:5:133:18 | axios.get(url) | json | true | | tst.js:134:5:134:48 | axios.g ... json'}) | tst.js:134:5:134:48 | axios.g ... json'}) | json | true | +| tst.js:139:5:139:14 | fetch(url) | tst.js:139:5:139:14 | fetch(url) | fetch.response | true | diff --git a/javascript/ql/test/library-tests/frameworks/ClientRequests/tst.js b/javascript/ql/test/library-tests/frameworks/ClientRequests/tst.js index 74db44b5a26..6792791e6fb 100644 --- a/javascript/ql/test/library-tests/frameworks/ClientRequests/tst.js +++ b/javascript/ql/test/library-tests/frameworks/ClientRequests/tst.js @@ -133,3 +133,8 @@ import {ClientRequest, net} from 'electron'; axios.get(url).then(response => response.data); axios.get({ url: url, responseType: 'json'}).then(response => response.data); }) + + +(function() { + fetch(url).then(r => r.json()).then(json => json); +})