Add property test for objects with constructor
This commit is contained in:
parent
b34e52b290
commit
d322d5dd9c
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue