Add property test for objects with constructor

This commit is contained in:
Scott Kyle 2016-02-18 13:48:07 -08:00
parent b34e52b290
commit d322d5dd9c
1 changed files with 4 additions and 0 deletions

View File

@ -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() {