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

Skip to content

Commit 7fb6615

Browse files
committed
JS: Test for XhrIo
1 parent 4eb072a commit 7fb6615

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ test_ClientRequest
4949
| tst.js:144:5:144:28 | got(url ... true }) |
5050
| tst.js:145:5:145:19 | got.stream(url) |
5151
| tst.js:149:5:149:23 | superagent.get(url) |
52+
| tst.js:158:5:158:17 | xhr.send(url) |
5253
test_getADataNode
5354
| tst.js:53:5:53:23 | axios({data: data}) | tst.js:53:18:53:21 | data |
5455
| tst.js:57:5:57:39 | axios.p ... data2}) | tst.js:57:19:57:23 | data1 |
@@ -138,6 +139,7 @@ test_getUrl
138139
| tst.js:144:5:144:28 | got(url ... true }) | tst.js:144:9:144:11 | url |
139140
| tst.js:145:5:145:19 | got.stream(url) | tst.js:145:16:145:18 | url |
140141
| tst.js:149:5:149:23 | superagent.get(url) | tst.js:149:20:149:22 | url |
142+
| tst.js:158:5:158:17 | xhr.send(url) | tst.js:158:14:158:16 | url |
141143
test_getAResponseDataNode
142144
| tst.js:19:5:19:23 | requestPromise(url) | tst.js:19:5:19:23 | requestPromise(url) | text | true |
143145
| tst.js:21:5:21:23 | superagent.get(url) | tst.js:21:5:21:23 | superagent.get(url) | stream | true |
@@ -181,3 +183,4 @@ test_getAResponseDataNode
181183
| tst.js:149:5:149:23 | superagent.get(url) | tst.js:149:5:149:23 | superagent.get(url) | stream | true |
182184
| tst.js:149:5:149:23 | superagent.get(url) | tst.js:149:30:149:32 | err | error | false |
183185
| tst.js:149:5:149:23 | superagent.get(url) | tst.js:149:35:149:37 | res | stream | false |
186+
| tst.js:158:5:158:17 | xhr.send(url) | tst.js:160:9:160:29 | xhr.get ... eJson() | json | false |

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,13 @@ import {ClientRequest, net} from 'electron';
150150
err;
151151
res;
152152
});
153-
});
153+
});
154+
155+
(function() {
156+
let XhrIo = goog.require('goog.net.XhrIo');
157+
let xhr = new XhrIo();
158+
xhr.send(url);
159+
xhr.addEventListener('readystatechange', function() {
160+
xhr.getResponseJson();
161+
});
162+
})

0 commit comments

Comments
 (0)