Supposed this is my view model
function VM()
{
var self = this;
this.Status = ko.observable(false);
this.A = ko.observable();
this.B = ko.computed(
function()
{
return self.A();
}
).extend( throttle: 200 );
this.B.subscribe(
function()
{
self.Status(true);
setTimeout( //ajax simulation
function(){
self.Status(false);
}
,200)
}
);
}
I want a test that verifies status toggles between true and false as A is set but i can't get past the dual async nature of the VM. Is there a way to test this with multiple stop()/start() calls?