Merge pull request #1419 from realm/use-latest-ros-2.0

Use latest pos 2.0 rc
This commit is contained in:
blagoev 2017-10-16 22:27:26 +03:00 committed by GitHub
commit 544d2c3fee
5 changed files with 16 additions and 15 deletions

View File

@ -2,4 +2,4 @@ PACKAGE_NAME=realm-js
VERSION=2.0.0-rc22
REALM_CORE_VERSION=4.0.2
REALM_SYNC_VERSION=2.0.2
REALM_OBJECT_SERVER_VERSION=2.0.0-rc.5
REALM_OBJECT_SERVER_VERSION=2.0.0-rc.10

View File

@ -3,4 +3,4 @@
set -o pipefail
set -e
echo "Downloading and starting ROS. Current directory: " $(pwd)
sh scripts/download-object-server.sh && ./node_modules/.bin/ros start --data realm-object-server-data && echo \"Server PID: $!\"
sh scripts/download-object-server.sh && export ROS_SKIP_PROMTS=true && ./node_modules/.bin/ros start --data realm-object-server-data && echo \"Server PID: $!\"

View File

@ -51,7 +51,7 @@ start_server() {
#enabled ROS logging
#sh ./object-server-for-testing/start-object-server.command &
./node_modules/.bin/ros start --data realm-object-server-data &
export ROS_SKIP_PROMTS=true && ./node_modules/.bin/ros start --data realm-object-server-data &
SERVER_PID=$!
echo ROS PID: ${SERVER_PID}
}

View File

@ -69,24 +69,21 @@ module.exports = {
Realm.schemaVersion('encrypted.realm', 'asdf');
});
},
};
testEncryptionWithSync: function() {
if (!global.enableSyncTests) {
return Promise.resolve();
}
if (global.enableSyncTests) {
module.exports.testEncryptionWithSync = function() {
Realm.Sync.User.login('http://localhost:9080', global.testAdminUserInfo.username, global.testAdminUserInfo.password, (error, user) => {
if (error) {
reject(error);
}
return Realm.Sync.User.login('http://localhost:9080', "realm-admin", '').then(adminUser => {
new Realm({
encryptionKey: new Int8Array(64),
sync: {
user: user,
user: adminUser,
url: 'realm://localhost:9080'
}
});
user.logout(); // FIXME: clearTestState() doesn't clean up enough and Realm.Sync.User.current might not work
resolve();
adminUser.logout(); // FIXME: clearTestState() doesn't clean up enough and Realm.Sync.User.current might not work
});
}
}
};

View File

@ -20,7 +20,11 @@
const Realm = require('realm');
global.enableSyncTests = Realm.Sync;
if( typeof Realm.Sync !== 'undefined' && Realm.Sync !== null ) {
global.WARNING = "global is not available in React Native. Use it only in tests";
global.enableSyncTests = true;
}
const isNodeProcess = typeof process === 'object' && process + '' === '[object process]';
function node_require(module) { return require(module); }