私のジャスミン テストでは、次の方法でアプリの初期化をテストします。
(function () {
"use strict";
describe('app', function () {
beforeEach(function() {
module('app');
});
it('should load without errors', function() {
expect(function() {
angular.bootstrap(angular.element('body'), ['app']);
}).not.toThrow();
});
});
}());
私の問題は、カルマを実行すると、次のようになることがよくあることです。
Expected function not to throw an exception , but it threw [ng:btstrpd] App Already Bootstrapped with this Element '<body>'
afterEach でアプリケーションを「ブートストラップ解除」するのが最善の解決策だと思いますが、ドキュメントでそうする方法が見つかりませんでした。
何か案は?