From d50e3ae68c6bb7a55e83c1a0e966834ace1a477e Mon Sep 17 00:00:00 2001 From: Scott Kyle Date: Wed, 21 Oct 2015 15:21:17 -0700 Subject: [PATCH] Add Object.keys test for Results --- tests/ResultsTests.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/ResultsTests.js b/tests/ResultsTests.js index b49bca85..d321a396 100644 --- a/tests/ResultsTests.js +++ b/tests/ResultsTests.js @@ -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]});