Fix flaky tests (#3724)

* adds continuation to silence rejected promises

* Wrap json parsing
This commit is contained in:
Florent Vilmart
2017-04-16 16:50:03 -04:00
committed by GitHub
parent dcd8e5626a
commit 5813fd0bf8
12 changed files with 63 additions and 14 deletions

View File

@@ -32,7 +32,11 @@ function graphRequest(path) {
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'qq auth is invalid for this user.');
}
data = data.substring(starPos + 1,endPos - 1);
data = JSON.parse(data);
try {
data = JSON.parse(data);
} catch(e) {
return reject(e);
}
resolve(data);
});
}).on('error', function () {