klass
klass copied to clipboard
Test case not testing anything (constructor bubbling)
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();
})