Fix flaky tests (#3724)
* adds continuation to silence rejected promises * Wrap json parsing
This commit is contained in:
@@ -26,7 +26,11 @@ function graphRequest(path) {
|
||||
data += chunk;
|
||||
});
|
||||
res.on('end', function () {
|
||||
data = JSON.parse(data);
|
||||
try {
|
||||
data = JSON.parse(data);
|
||||
} catch(e) {
|
||||
return reject(e);
|
||||
}
|
||||
resolve(data);
|
||||
});
|
||||
}).on('error', function () {
|
||||
|
||||
Reference in New Issue
Block a user