0
最近、Angularアプリケーションを1.5.8から1.6.1に更新しました。 テストでは、$ httpBackend.flush()はルートの変更を開始し、イベントをリッスンしている関数の呼び出しを開始した '$ routeChangeStart'メッセージをブロードキャストします。
移行中に何か不足していますか?
//Function listening to the $routeChangeStart
$rootScope.$on("$routeChangeStart", function (event, next) {
console.log('This is called');
});
//Test
describe('Testing', function() {
it.only('Testing', function() {
//Code
$httpBackend.when('GET', endpoints.endpoint1).respond([]);
$httpBackend.flush();
});
});
@Codesinghが、それはどのような違いを生むん – Codesingh
を共有してください! $ httpBackend.flush()はルート変更を呼び出しています。 – Sabby62