diff --git a/tests/js/migration-tests.js b/tests/js/migration-tests.js index eabadf25..366ac7f0 100644 --- a/tests/js/migration-tests.js +++ b/tests/js/migration-tests.js @@ -106,6 +106,10 @@ module.exports = BaseTest.extend({ TestCase.assertEqual(newObjects[0].prop1, 1); newObjects[0].renamed = oldObjects[0].prop0; + + TestCase.assertThrows(function() { + oldObjects[0].prop0 = 'throws'; + }); } }); diff --git a/tests/js/realm-tests.js b/tests/js/realm-tests.js index b378456a..b83462e3 100644 --- a/tests/js/realm-tests.js +++ b/tests/js/realm-tests.js @@ -350,27 +350,30 @@ module.exports = BaseTest.extend({ new Realm({schema: [NotIndexed], path: '1'}); + var IndexedSchema = { + name: 'IndexedSchema', + }; TestCase.assertThrows(function() { - schemas.IndexedTypes.properties = { floatCol: {type: 'float', indexed: true} } - new Realm({schema: [schemas.IndexedTypes], path: '2'}); + IndexedSchema.properties = { floatCol: {type: 'float', indexed: true} }; + new Realm({schema: [IndexedSchema], path: '2'}); }); TestCase.assertThrows(function() { - schemas.IndexedTypes.properties = { doubleCol: {type: 'double', indexed: true} } - new Realm({schema: [schemas.IndexedTypes], path: '3'}); + IndexedSchema.properties = { doubleCol: {type: 'double', indexed: true} } + new Realm({schema: [IndexedSchema], path: '3'}); }); TestCase.assertThrows(function() { - schemas.IndexedTypes.properties = { dataCol: {type: 'data', indexed: true} } - new Realm({schema: [schemas.IndexedTypes], path: '4'}); + IndexedSchema.properties = { dataCol: {type: 'data', indexed: true} } + new Realm({schema: [IndexedSchema], path: '4'}); }); // primary key - schemas.IndexedTypes.primaryKey = 'boolCol'; - schemas.IndexedTypes.properties = { boolCol: {type: 'bool', indexed: true} } + IndexedSchema.properties = { boolCol: {type: 'bool', indexed: true} }; + IndexedSchema.primaryKey = 'boolCol'; - // Test this doesn't throw - new Realm({schema: [schemas.IndexedTypes], path: '5'}); + // Test this doesn't throw + new Realm({schema: [IndexedSchema], path: '5'}); }, testRealmCreateWithDefaults: function() {