Add Object.keys test for Results

This commit is contained in:
Scott Kyle 2015-10-21 15:21:17 -07:00
parent d55d42da8d
commit d50e3ae68c
1 changed files with 8 additions and 5 deletions

View File

@ -74,11 +74,14 @@ module.exports = BaseTest.extend({
});
var count = 0;
for (var object in objects) {
count++;
//TestCase.assertTrue(object instanceof Object);
}
TestCase.assertEqual(1, count);
var keys = Object.keys(objects);
for (var index in objects) {
TestCase.assertEqual(count++, +index);
TestCase.assertEqual(keys[index], index);
}
TestCase.assertEqual(count, 1);
TestCase.assertEqual(keys.length, 1);
},
testSort: function() {
var realm = new Realm({schema: [schemas.TestObject]});