jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 243 forks source link

Mocha afterEach hook throwing exception. #329

Closed phyllisstein closed 9 years ago

phyllisstein commented 9 years ago

Hey there! Hope this nag finds you well. I noticed that lines 1222–1224 of teaspoon-mocha.js, which comprise the afterEach hook, are consistently causing Mocha to raise an exception:

Uncaught TypeError: object is not a function (http://interfacelift.dev/assets/mocha/1.17.1-e9bc85abc704a2e01ee65f7697c62ea12c4fa21d6175607888399bdc34868d38.js:4341)
Error: Uncaught TypeError: object is not a function (http://interfacelift.dev/assets/mocha/1.17.1-e9bc85abc704a2e01ee65f7697c62ea12c4fa21d6175607888399bdc34868d38.js:4341)
    at process.on.global.onerror (http://interfacelift.dev/assets/mocha/1.17.1-e9bc85abc704a2e01ee65f7697c62ea12c4fa21d6175607888399bdc34868d38.js:5709:12)

I've seen it in Mocha 2.2.0, 2.1.0, and 1.17.0; not sure about the earlier version yet. Here's my spec_helper.coffee:

#= require support/phantomjs-shim
#= require chai

chai.config.includeStack = true
mocha.setup('bdd')
should = chai.should()

...and my test, spec/javascripts/dummy/DummySpec.coffee:

describe 'the thing', ->
  it 'does the thing', ->
    (2 + 2).should.eql 4
    return

Removing the offending lines seems to solve the problem, though I'm not sure what else it might break.

I'm putting together a demo repo now in case it's helpful! Will update here when it's ready.

phyllisstein commented 9 years ago

Withdrawn, it was all ng-annotate's fault. (╯°□°)╯︵ ┻━┻