Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4eb072a

Browse files
committed
JS: Test for 'superagent' package
1 parent ce4f098 commit 4eb072a

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

javascript/ql/test/library-tests/frameworks/ClientRequests/ClientRequests.expected

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ test_ClientRequest
4848
| tst.js:143:5:143:12 | got(url) |
4949
| tst.js:144:5:144:28 | got(url ... true }) |
5050
| tst.js:145:5:145:19 | got.stream(url) |
51+
| tst.js:149:5:149:23 | superagent.get(url) |
5152
test_getADataNode
5253
| tst.js:53:5:53:23 | axios({data: data}) | tst.js:53:18:53:21 | data |
5354
| tst.js:57:5:57:39 | axios.p ... data2}) | tst.js:57:19:57:23 | data1 |
@@ -136,9 +137,10 @@ test_getUrl
136137
| tst.js:143:5:143:12 | got(url) | tst.js:143:9:143:11 | url |
137138
| tst.js:144:5:144:28 | got(url ... true }) | tst.js:144:9:144:11 | url |
138139
| tst.js:145:5:145:19 | got.stream(url) | tst.js:145:16:145:18 | url |
140+
| tst.js:149:5:149:23 | superagent.get(url) | tst.js:149:20:149:22 | url |
139141
test_getAResponseDataNode
140142
| tst.js:19:5:19:23 | requestPromise(url) | tst.js:19:5:19:23 | requestPromise(url) | text | true |
141-
| tst.js:21:5:21:23 | superagent.get(url) | tst.js:21:5:21:23 | superagent.get(url) | text | true |
143+
| tst.js:21:5:21:23 | superagent.get(url) | tst.js:21:5:21:23 | superagent.get(url) | stream | true |
142144
| tst.js:25:5:25:14 | axios(url) | tst.js:25:5:25:14 | axios(url) | json | true |
143145
| tst.js:27:5:27:18 | axios.get(url) | tst.js:27:5:27:18 | axios.get(url) | json | true |
144146
| tst.js:29:5:29:23 | axios({ url: url }) | tst.js:29:5:29:23 | axios({ url: url }) | json | true |
@@ -152,11 +154,11 @@ test_getAResponseDataNode
152154
| tst.js:59:5:59:52 | axios({ ... sData}) | tst.js:59:5:59:52 | axios({ ... sData}) | json | true |
153155
| tst.js:61:5:61:60 | window. ... yData}) | tst.js:61:5:61:60 | window. ... yData}) | fetch.response | true |
154156
| tst.js:63:5:63:68 | got(url ... yData}) | tst.js:63:5:63:68 | got(url ... yData}) | text | true |
155-
| tst.js:65:5:65:23 | superagent.get(url) | tst.js:65:5:65:23 | superagent.get(url) | text | true |
156-
| tst.js:66:5:66:23 | superagent.get(url) | tst.js:66:5:66:23 | superagent.get(url) | text | true |
157-
| tst.js:67:5:67:24 | superagent.post(url) | tst.js:67:5:67:24 | superagent.post(url) | text | true |
158-
| tst.js:68:5:68:23 | superagent.get(url) | tst.js:68:5:68:23 | superagent.get(url) | text | true |
159-
| tst.js:69:5:69:23 | superagent.get(url) | tst.js:69:5:69:23 | superagent.get(url) | text | true |
157+
| tst.js:65:5:65:23 | superagent.get(url) | tst.js:65:5:65:23 | superagent.get(url) | stream | true |
158+
| tst.js:66:5:66:23 | superagent.get(url) | tst.js:66:5:66:23 | superagent.get(url) | stream | true |
159+
| tst.js:67:5:67:24 | superagent.post(url) | tst.js:67:5:67:24 | superagent.post(url) | stream | true |
160+
| tst.js:68:5:68:23 | superagent.get(url) | tst.js:68:5:68:23 | superagent.get(url) | stream | true |
161+
| tst.js:69:5:69:23 | superagent.get(url) | tst.js:69:5:69:23 | superagent.get(url) | stream | true |
160162
| tst.js:89:5:89:23 | axios({host: host}) | tst.js:89:5:89:23 | axios({host: host}) | json | true |
161163
| tst.js:91:5:91:34 | got(rel ... host}) | tst.js:91:5:91:34 | got(rel ... host}) | text | true |
162164
| tst.js:98:15:98:34 | new XMLHttpRequest() | tst.js:103:9:103:21 | this.response | json | false |
@@ -176,3 +178,6 @@ test_getAResponseDataNode
176178
| tst.js:143:5:143:12 | got(url) | tst.js:143:5:143:12 | got(url) | text | true |
177179
| tst.js:144:5:144:28 | got(url ... true }) | tst.js:144:5:144:28 | got(url ... true }) | json | true |
178180
| tst.js:145:5:145:19 | got.stream(url) | tst.js:145:5:145:19 | got.stream(url) | stream | false |
181+
| tst.js:149:5:149:23 | superagent.get(url) | tst.js:149:5:149:23 | superagent.get(url) | stream | true |
182+
| tst.js:149:5:149:23 | superagent.get(url) | tst.js:149:30:149:32 | err | error | false |
183+
| tst.js:149:5:149:23 | superagent.get(url) | tst.js:149:35:149:37 | res | stream | false |

javascript/ql/test/library-tests/frameworks/ClientRequests/tst.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,10 @@ import {ClientRequest, net} from 'electron';
144144
got(url, { json: true }).then(response => response.body);
145145
got.stream(url).pipe(process.stdout);
146146
})
147+
148+
(function() {
149+
superagent.get(url).end((err, res) => {
150+
err;
151+
res;
152+
});
153+
});

0 commit comments

Comments
 (0)