From 6a284c94b1fd2fe9fa3f91770890866fb03cb4f8 Mon Sep 17 00:00:00 2001 From: blagoev Date: Fri, 7 Jul 2017 12:46:57 +0300 Subject: [PATCH] =?UTF-8?q?don=E2=80=99t=20run=20retrieveAccount=20tests?= =?UTF-8?q?=20on=20RN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/js/index.js | 6 +++--- tests/js/user-tests.js | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/js/index.js b/tests/js/index.js index 0f78ff10..47e5baba 100644 --- a/tests/js/index.js +++ b/tests/js/index.js @@ -44,8 +44,8 @@ if (Realm.Sync) { function node_require(module) { return require(module); } // If on node, run the async tests -const isNodeProcess = typeof process === 'object' && process + '' === '[object process]' -if (isNodeProcess) { +global.isNodeProcess = typeof process === 'object' && process + '' === '[object process]' +if (global.isNodeProcess) { TESTS.AsyncTests = node_require('./async-tests'); } @@ -75,7 +75,7 @@ exports.registerTests = function(tests) { }; exports.prepare = function(done) { - if (!isNodeProcess || global.testAdminUserInfo) { + if (!global.isNodeProcess || global.testAdminUserInfo) { done(); } diff --git a/tests/js/user-tests.js b/tests/js/user-tests.js index 9a8b5205..73c3f12e 100644 --- a/tests/js/user-tests.js +++ b/tests/js/user-tests.js @@ -297,6 +297,10 @@ module.exports = { testRetrieveAccount() { return new Promise((resolve, reject) => { + if (!global.isNodeProcess) { + resolve(); + } + if (!global.testAdminUserInfo) { reject("Test requires an admin user"); } @@ -333,6 +337,10 @@ module.exports = { testRetrieveNotExistingAccount() { return new Promise((resolve, reject) => { + if (!global.isNodeProcess) { + resolve(); + } + if (!global.testAdminUserInfo) { reject("Test requires an admin user"); }