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

rake task exits with wrong exit code if test names are duplicated #104

Open
dreamfall opened this issue Feb 5, 2013 · 4 comments
Open

Comments

@dreamfall
Copy link
Collaborator

If names of test suites are identical, the first test fails and the second passes, rake tasks finishes with wrong exit code.

Example:

describe 'TestApp', ->
  it 'suiteName', ->
    expect(false).to.be.true

  it 'suiteName', ->
    expect(true).to.be.true

Output of rake task will be the following

~$ rake konacha:run
F.
1 examples, 0 failed, 0 pending

This happens because Reporter#update_or_create_object method overwrites the first example from Reporter#examples with the second one because their data['fullTitle']] are the same.

@jfirebaugh
Copy link
Owner

Good find! Do you think you'd be able to make a pull request to fix this?

@ragalie
Copy link
Collaborator

ragalie commented Feb 13, 2013

The reason it's keyed on fullTitle is because it doesn't look like mocha assigns an ID to the Test or Suite objects.

We could probably assign an ID in runner.js and key on that, which should solve this issue.

@dreamfall
Copy link
Collaborator Author

Ok, I'll try to fix it.

@dreamfall
Copy link
Collaborator Author

Well, sorry, guys, but it seems to me that I'm not as good at javascript as i thought. I can't find any good solution to fix this problem.

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

3 participants