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

@@ -10,8 +10,12 @@ describe('AuthenticationProviers', function() {
var provider = require("../src/Adapters/Auth/" + providerName);
jequal(typeof provider.validateAuthData, "function");
jequal(typeof provider.validateAppId, "function");
jequal(provider.validateAuthData({}, {}).constructor, Promise.prototype.constructor);
jequal(provider.validateAppId("app", "key", {}).constructor, Promise.prototype.constructor);
const authDataPromise = provider.validateAuthData({}, {});
const validateAppIdPromise = provider.validateAppId("app", "key", {});
jequal(authDataPromise.constructor, Promise.prototype.constructor);
jequal(validateAppIdPromise.constructor, Promise.prototype.constructor);
authDataPromise.then(()=>{}, ()=>{});
validateAppIdPromise.then(()=>{}, ()=>{});
done();
});
});