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

-w option, i don't understand, or it's not working like expected #857

Closed
petershaw opened this issue May 22, 2013 · 5 comments
Closed

-w option, i don't understand, or it's not working like expected #857

petershaw opened this issue May 22, 2013 · 5 comments

Comments

@petershaw
Copy link

Hi,
whenever i run mocha ion watch mode, the first run wokes great. All after then will bereportet with 0 tests complete. No tests are executed anymore.

Lets assume i have a test like:

var assert = require("assert")

describe('A Self Test', function(){
  describe('#indexOf()', function(){
    it('should return -1 when the value is not present', function(){
      assert.equal(-1, [1,2,3].indexOf(5));
      assert.equal(-1, [1,2,3].indexOf(0));
    })
  })
});

and run mocha with:

node_modules/mocha/bin/mocha -w test/aselftest.js 

the output after breaking the test is:

  A Self Test
    #indexOf()
      ✓ should return -1 when the value is not present 


  1 test complete (11 ms)

  0 tests complete (0 ms)

-V shows mocha Version 1.9.0

Is it a missunderstanding or something in the code? How can I use -w? How can i test continuously.

Thanks,
Peter Shaw

@tj
Copy link
Contributor

tj commented May 22, 2013

works fine for me:

  1 test complete (0 ms)


  test
․

  1 test complete (1 ms)


  stuff
․

  1 test complete (0 ms)

@petershaw
Copy link
Author

Hi TJ,
Thanks for your response.

I updated to 1.10.0 but have the same issues. I uploaded a 1:45min video to demonstrate whats happening here. so maybe you have the time and the nerves to watch it an my bad english pronunciation :-)
I do something wrong, but i can't figure out what... maybe i can fix it, or annotate the docs, can you push me into the right direction?
http://www.youtube.com/watch?v=__Ot776uWB8&feature=youtube_gdata_player

Thanks a lot,
peter.

@benjie
Copy link
Contributor

benjie commented Jan 4, 2014

@petershaw I had this issue recently; it turned out it was because I was using the wrong UI (--ui tdd instead of --ui bdd). Simply changing the line in my mocha.opts to match my code with --ui bdd fixed the issue.

@ladariha
Copy link

I have the same problem, I don't have any custom settings. I tried to create mocha.opts and placed there --ui bdd but no change at all

Mocha 2.0.1

@jbnicolai
Copy link

Closing in favor of #1780

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

No branches or pull requests

5 participants