Я работаю из этого урока и имеет googled ad nauseum, но я не могу получить то, что кажется тривиальным ngAnimate unit test работает.
У меня ngAnimate хорошо работает в приложении. Все основные библиотеки Angular - это версии 1.4.7.
Модуль
angular.module 'MyAnimation', [ 'ngAnimate' ]
  .animation '.added-class', ->
    addClass: (element, className, done) ->
      console.log 'add class triggered'
      element.css 'opacity', '0.5'
      done()
Test
describe 'MyAnimation', ->
  beforeEach -> module 'ngAnimate'
  beforeEach -> module 'ngAnimateMock'
  beforeEach -> module 'MyAnimation'
  it 'animates', -> inject ($animate, $rootScope, $rootElement) ->
    $animate.enabled(true)
    divElement = angular.element '<div>my div</div>'
    # Kick off initial digest loop in which no animations are run.
    $rootScope.$digest()
    # Trigger animation.
    $animate.addClass divElement, 'added-class'
    $rootScope.$digest()
    # Tried this, doesn't seem to do anything.
    # $animate.flush()
    # Results in AssertionError: expected '' to equal '0.5'
    expect(divElement.css('opacity')).to.eq '0.5'
Я уверен, что модуль включен в тест, но запуск $animate.enter даже не дает мне мой вывод log.
Я пробовал это с другими функциями $animate, и я ничего не получаю. Помощь?
