yeoman/generator-webapp

TDD test file is the same as BDD, so it doesn't work because Mocha expects a different interface

flaviodut opened this issue · 5 comments

I'm trying to run test (TDD) in my application but it's returning "Uncaught ReferenceError: describe is not defined" in console. Even in a brand new scaffolding project this error shows up. Am I missing something? Thanks.

Thanks @flaviodut for reporting it.

What SO are you using? and Nodejs version?

Hello @UlisesGascon: Windows 7 Pro with Node v10.15.1.

I guess people use TDD so rarely that this bug hasn't surfaced until now. @flaviodut as you can see in Mocha's docs, TDD doesn't use describe, it uses suite, test etc. Those are the ones that are available globally.

We'll fix this in generator-mocha.

Ok, fix published in 4.0.0-7.

To fix this locally you can either follow the TDD style from Mocha's docs manually, or:

  • rm -r test
  • yarn global add generator-mocha
  • yo mocha
  • select TDD as before

It works! Thanks.