mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-11 06:46:03 +00:00
We might be running in a node process without global.testAdminUserInfo
This commit is contained in:
parent
97800e35b1
commit
f958052c1b
@ -89,7 +89,7 @@ function callbackTest(requestFunc, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
||||||
testLogout() {
|
testLogout() {
|
||||||
var username = uuid();
|
var username = uuid();
|
||||||
return callbackTest((callback) => Realm.Sync.User.register('http://localhost:9080', username, 'password', callback), (error, user) => {
|
return callbackTest((callback) => Realm.Sync.User.register('http://localhost:9080', username, 'password', callback), (error, user) => {
|
||||||
@ -132,7 +132,7 @@ module.exports = {
|
|||||||
TestCase.assertUndefined(user);
|
TestCase.assertUndefined(user);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
testRegisterMissingUsername() {
|
testRegisterMissingUsername() {
|
||||||
return new Promise((resolve, _reject) => {
|
return new Promise((resolve, _reject) => {
|
||||||
@ -298,13 +298,9 @@ module.exports = {
|
|||||||
|
|
||||||
testRetrieveAccount() {
|
testRetrieveAccount() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (!isNodeProcess) {
|
if (!isNodeProcess || !global.testAdminUserInfo) {
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!global.testAdminUserInfo) {
|
|
||||||
reject("Test requires an admin user");
|
|
||||||
}
|
|
||||||
|
|
||||||
Realm.Sync.User.login('http://localhost:9080', global.testAdminUserInfo.username, global.testAdminUserInfo.password, (error, user) => {
|
Realm.Sync.User.login('http://localhost:9080', global.testAdminUserInfo.username, global.testAdminUserInfo.password, (error, user) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
@ -338,14 +334,10 @@ module.exports = {
|
|||||||
|
|
||||||
testRetrieveNotExistingAccount() {
|
testRetrieveNotExistingAccount() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (!isNodeProcess) {
|
if (!isNodeProcess || !global.testAdminUserInfo) {
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!global.testAdminUserInfo) {
|
|
||||||
reject("Test requires an admin user");
|
|
||||||
}
|
|
||||||
|
|
||||||
Realm.Sync.User.login('http://localhost:9080', global.testAdminUserInfo.username, global.testAdminUserInfo.password, (error, user) => {
|
Realm.Sync.User.login('http://localhost:9080', global.testAdminUserInfo.username, global.testAdminUserInfo.password, (error, user) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
reject(error);
|
reject(error);
|
||||||
@ -427,4 +419,3 @@ module.exports = {
|
|||||||
}, */
|
}, */
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user