From d322d5dd9c776bd08448cd45034154ec9655cad7 Mon Sep 17 00:00:00 2001 From: Scott Kyle Date: Thu, 18 Feb 2016 13:48:07 -0800 Subject: [PATCH] Add property test for objects with constructor --- tests/lib/realm-tests.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/lib/realm-tests.js b/tests/lib/realm-tests.js index aa062ac2..4c42e969 100644 --- a/tests/lib/realm-tests.js +++ b/tests/lib/realm-tests.js @@ -266,6 +266,7 @@ module.exports = BaseTest.extend({ function CustomObject() { customCreated++; + this.intCol *= 100; } CustomObject.schema = { name: 'CustomObject', @@ -295,6 +296,9 @@ module.exports = BaseTest.extend({ TestCase.assertTrue(object instanceof CustomObject); TestCase.assertTrue(Object.getPrototypeOf(object) == CustomObject.prototype); TestCase.assertEqual(customCreated, 1); + + // Should have been multiplied by 100 in the constructor. + TestCase.assertEqual(object.intCol, 100); }); TestCase.assertThrows(function() {