Skip to content

Feature request: Support mocha #4071

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

Closed
delasteve opened this issue Jan 17, 2017 · 13 comments
Closed

Feature request: Support mocha #4071

delasteve opened this issue Jan 17, 2017 · 13 comments
Labels
needs: investigation Requires some digging to determine if action is needed

Comments

@delasteve
Copy link
Contributor

delasteve commented Jan 17, 2017

It would be great to have an option to use mocha and chai (and sinon) instead of using jasmine.

@filipesilva filipesilva added command: test needs: investigation Requires some digging to determine if action is needed labels Jan 17, 2017
@hansl
Copy link
Contributor

hansl commented Jan 18, 2017

I'm not 100% sold on officially supporting Mocha; I think we should stick to support 1 testing framework and if you want to use another it's on you. I'll chat to devrel about that.

It's great that it works though.

@delasteve delasteve changed the title Karma with Mocha rebuild / test times double that of Jasmine Feature request: Support mocha Feb 11, 2017
@arranbartish
Copy link

I've created a seed where I am trying to provide demonstration of doing exactly this. Unfortunately I've completely failed to get it to work for protractor+mocha in the ng e2e situation. To that end I've open question on stack overflow to find insight on that.

I was able to get ng test to work really well though so 🏆 goes to the angular-cli + karma crew for making it easy to switch things around. A working example here using angular-cli rc.1 https://github.com/arranbartish/angular-cli-seed/tree/e2bc13cd51a4a16911039b853084f5b884966bc9 for anyone looking for ideas.

@arranbartish
Copy link

Any chance this feature request could include command: e2e as well as command: test ?

@arranbartish
Copy link

Anyone passing through and looking for a working example of angular-cli (rc.2) configured to use mocha for the following runners

  • karma
  • wallabyjs
  • protractor runners

here is some working code.

@filipesilva
Copy link
Contributor

This isn't something we're looking at supporting right now, but could be done with the introduction of #2618.

@mmc41
Copy link

mmc41 commented Jun 25, 2017

@filipesilva I am interested in chai support in particular. Would it be possible for angular-cli to support chai instead of jasmine?

@filipesilva
Copy link
Contributor

It's not something we're looking at right now, no. I suppose it would need a custom compilation plugin like what we do now for karma, and some other stuff.

@JemiloII
Copy link

JemiloII commented Jun 7, 2018

I would appreciate seeing mocha used instead of jasmine. I have more tools that integrate with mocha over jasmine and the .only / .skip, in my opinion, is much nicer to read than fdescribe and xdescribe. Jasmine also has had some pretty strange crashes just because a test would fail. It'd be nice to tell me the test failed instead of crashing the entire suite, letting chrome hang, and never printing out the real error. What happened? The setup in the before/beforeEach failed. Kinda stupid.

@Neutrino-Sunset
Copy link

Jasmine is horrific. Anything that exposes a property named 'and' needs to be shot and incinerated.

@oscarr-reyes
Copy link

are there no solutions for doing tests on mocha?, this is important for making tests on server side, as well as just having one test runner than multiple just for testing one whole app

@soupman99
Copy link

I agree. It’s soanniying to constant have to keep up with both.

@LosD
Copy link

LosD commented Sep 6, 2019

@hansl @filipesilva I get the "support one thing", but does it have to be the slowest one, the one that has most issues with CI hosting, and the one that crashes instead actually reporting errors half the time?

anything would be better than Karma/Jasmine (okay, if you're developing on Windows, maybe Jest is actually worse than Jasmine at the moment, but I hope that's just temporary thing)

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: investigation Requires some digging to determine if action is needed
Projects
None yet
Development

No branches or pull requests

10 participants