Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
flaviodut opened this issue Oct 25, 2019 · 5 comments
Assignees
Labels

Comments

@flaviodut
Copy link

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
Copy link
Member

Thanks @flaviodut for reporting it.

What SO are you using? and Nodejs version?

@flaviodut
Copy link
Author

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

@silvenon
Copy link
Member

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 silvenon changed the title Trying to run test TDD test file is the same as BDD, so it doesn't work because Mocha expects a different interface Nov 11, 2019
@silvenon
Copy link
Member

silvenon commented Nov 11, 2019

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

@flaviodut
Copy link
Author

It works! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants