klass icon indicating copy to clipboard operation
klass copied to clipboard

Test case not testing anything (constructor bubbling)

Open bcowgill opened this issue 10 years ago • 0 comments

This test case will show green even when it fails: Commenting out the Baz initialize function shows a test pass. You need to change ok(false,...) in both Foo and Bar's initialize function to have an actual test.

test('object literal with initialize shouldn't bubble constructor', 1, function () { var Foo = $k({ initialize: function() { ok(true, 'object literal with initialize shouldn't bubble constructor'); } });

var Bar = Foo.extend({
  initialize: function() {
    ok(true, 'object literal with initialize shouldn\'t bubble constructor');
  }
});

var Baz = Bar.extend({
  initialize: function() {
    ok(true, 'object literal with initialize shouldn\'t bubble constructor');
  }
});

//should only fire Baz's init
var baz = new Baz();

})

bcowgill avatar Feb 15 '15 16:02 bcowgill