Merge branch 'al-sync-user-tests' of https://github.com/realm/realm-js into al-sync-user-tests

This commit is contained in:
Nabil Hachicha 2016-11-14 13:26:54 +00:00
commit a53e802df3
2 changed files with 3 additions and 7 deletions

View File

@ -458,6 +458,8 @@ void RealmClass<T>::clear_test_state(ContextType ctx, ObjectType this_object, si
for(auto &user : SyncManager::shared().all_users()) { for(auto &user : SyncManager::shared().all_users()) {
user->log_out(); user->log_out();
} }
SyncManager::shared().reset_for_testing();
SyncManager::shared().configure_file_system(default_realm_file_directory(), SyncManager::MetadataMode::NoEncryption);
#endif #endif
delete_all_realms(); delete_all_realms();
} }

View File

@ -27,13 +27,7 @@ const userTests = require('../js/user-tests');
describe('SyncTests', () => { describe('SyncTests', () => {
jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000; jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;
beforeEach(() => Realm.clearTestState()); beforeEach(() => Realm.clearTestState());
afterEach(() => { afterEach(() => Realm.clearTestState());
Realm.clearTestState();
let users = Realm.Sync.User.all;
Object.keys(users).forEach((identity) => {
users[identity].logout();
});
});
for (const testName in userTests) { for (const testName in userTests) {
it(testName, (done) => { it(testName, (done) => {