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

Allow multiple mocha test suites #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stutrek
Copy link

@stutrek stutrek commented Jun 19, 2015

When tests on suites other than the first one were failing it would not report it. This appears to fix that issue.

It also checks the pending property of the tests so it doesn't report that it's done ahead of time.

@johanneswuerbach
Copy link
Owner

Hey are you using just saucie or ember-cli?

@stutrek
Copy link
Author

stutrek commented Jun 19, 2015

I'm using testem.

@johanneswuerbach
Copy link
Owner

Would you mind squashing your commits and adding a test?

@stutrek
Copy link
Author

stutrek commented Jun 22, 2015

Squashed the commits, are there already tests for mocha or just QUnit?

@johanneswuerbach
Copy link
Owner

atm only qunit, I can look into adding a test if you prefer, but I won't have time until the end of the week.

@stutrek
Copy link
Author

stutrek commented Jun 22, 2015

You might want to check it out... This PR makes it work for my purposes but no matter how many tests you have it will always report just one test.

@johanneswuerbach
Copy link
Owner

Yep, I didn't found a way to access mocha test results reliable in every env. The best way (and what I currently do in ember-cli-sauce) is to add something like this to your tests:

window.mochaRunner = mocha.run();
after(function() {
  window.global_test_results = window.mochaRunner.stats;
  window.global_test_results.reports = [];
});

saucie will detect this variable automatically and prefer it over manually parsing mocha results.

@stutrek
Copy link
Author

stutrek commented Jun 22, 2015

That's what that's for!!

It looks like the mocha results are a tree, you could probably iterate through it to get a running total.

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

Successfully merging this pull request may close these issues.

None yet

2 participants