yeoman / generator-webapp

A gulp.js generator for modern webapps
3.77k stars 708 forks source link

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

Closed flaviodut closed 4 years ago

flaviodut commented 4 years ago

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.

UlisesGascon commented 4 years ago

Thanks @flaviodut for reporting it.

What SO are you using? and Nodejs version?

flaviodut commented 4 years ago

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

silvenon commented 4 years ago

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.

silvenon commented 4 years ago

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:

flaviodut commented 4 years ago

It works! Thanks.