mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-26 14:30:36 +00:00
Merge pull request #851 from realm/rt/fix-for-node-server-sdk
Fix loading the Realm constructor for the node-server-sdk
This commit is contained in:
commit
6a076efa95
@ -45,6 +45,7 @@ module.exports = function(realmConstructor) {
|
||||
let userMethods = require('./user-methods');
|
||||
Object.defineProperties(realmConstructor.Sync.User, getOwnPropertyDescriptors(userMethods.static));
|
||||
Object.defineProperties(realmConstructor.Sync.User.prototype, getOwnPropertyDescriptors(userMethods.instance));
|
||||
Object.defineProperty(realmConstructor.Sync.User, '_realmConstructor', { value: realmConstructor });
|
||||
|
||||
realmConstructor.Sync.AuthError = require('./errors').AuthError;
|
||||
|
||||
|
@ -179,8 +179,7 @@ module.exports = {
|
||||
|
||||
url.set('pathname', '/~/__management');
|
||||
|
||||
const realmConstructor = require('./index');
|
||||
return new realmConstructor({
|
||||
return new this.constructor._realmConstructor({
|
||||
schema: require('./management-schema'),
|
||||
sync: {
|
||||
user: this,
|
||||
|
@ -66,10 +66,9 @@ module.exports = {
|
||||
TestCase.assertEqual(session.state, 'active');
|
||||
|
||||
// give the session enough time to refresh its access token and bind itself
|
||||
let timeout = 500;
|
||||
if (typeof window !== 'undefined') {
|
||||
timeout = 2500; // need a longer timeout under React Native because remote debugging
|
||||
}
|
||||
// TODO: Use an event to discover when the session is bound
|
||||
let timeout = 3000;
|
||||
|
||||
return wait(timeout).then(() => {
|
||||
TestCase.assertEqual(session.url, `realm://localhost:9080/${user.identity}/myrealm`);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user