add tests

This commit is contained in:
Ari Lazier 2016-03-17 15:50:10 -07:00
parent 324c3d702b
commit 5de63ac401
1 changed files with 10 additions and 0 deletions

View File

@ -117,6 +117,16 @@ module.exports = BaseTest.extend({
TestCase.assertEqual(Realm.defaultPath, newPath, "defaultPath should have been updated");
},
testRealmSchemaVersion: function() {
TestCase.assertEqual(Realm.schemaVersion(Realm.defaultPath), 0xFFFFFFFFFFFFFFFF);
var realm = new Realm({schema: []});
TestCase.assertEqual(Realm.schemaVersion(Realm.defaultPath), 0);
realm = new Realm({schema: [], schemaVersion: 2, path: 'another.realm'});
TestCase.assertEqual(Realm.schemaVersion('another.realm'), 2);
},
testRealmCreate: function() {
var realm = new Realm({schema: [schemas.IntPrimary, schemas.AllTypes, schemas.TestObject]});