Add missing sync error (#925)
* Add missing sync error * Make unit tests work without sync * Wording fix
This commit is contained in:
parent
c4535bdf1a
commit
f551a51acc
|
@ -66,6 +66,12 @@ module.exports = function(realmConstructor) {
|
|||
|
||||
setConstructorOnPrototype(realmConstructor.Sync.User);
|
||||
setConstructorOnPrototype(realmConstructor.Sync.Session);
|
||||
} else {
|
||||
Object.defineProperty(realmConstructor, 'Sync', {
|
||||
get: function () {
|
||||
throw new Error("Realm.Sync is not available. Note that the developer edition of the Node.JS SDK for Realm does not include sync on Linux.");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// TODO: Remove this now useless object.
|
||||
|
@ -99,4 +105,4 @@ module.exports = function(realmConstructor) {
|
|||
},
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,10 +35,11 @@ if (!(typeof process === 'object' && process.platform === 'win32')) {
|
|||
}
|
||||
|
||||
// If sync is enabled, run the user tests
|
||||
if (Realm.Sync) {
|
||||
try {
|
||||
Realm.Sync; // This will throw if Sync is disabled.
|
||||
TESTS.UserTests = require('./user-tests');
|
||||
TESTS.SessionTests = require('./session-tests');
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
function node_require(module) { return require(module); }
|
||||
|
||||
|
|
Loading…
Reference in New Issue