testing_1.it('should emit a change event when the `checked` value changes', function () { // TODO(jelbourn): this *should* work with async(), but fixture.whenStable currently doesn't // know to look at pending macro tasks. // See https://github.com/angular/angular/issues/8389 // As a short-term solution, use a promise (which jasmine knows how to understand). var promiseCompleter = new promise_completer_1.PromiseCompleter(); checkboxInstance.change.subscribe(function () { promiseCompleter.resolve(); }); testComponent.isChecked = true; fixture.detectChanges(); return promiseCompleter.promise; });
checkboxInstance.change.subscribe(function () { promiseCompleter.resolve(); });