Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Print test errors when they exists #3

wants to merge 2 commits into from

2 participants


Instead of just printing the summary it prints the test error output.


Thanks for the pull request. I'm under a bit of deadline pressure right now but I will definitely look it over during the weekend. Thanks again!


Hey, so I don't understand what exactly you are trying to do here. The error details are printed at the end of the run even without your patch here:

The only difference I saw with and without your pull request is that additional error blocks are printed in red. There is no extra information (except the red color) provided by your patch.

Could you explain what you are trying to accomplish?


For some reason the output for me is this one:


I will investigate in more details soon.



OK, It looks like you are trying to run ytestrunner from the command line after globally installing it. What's happening is that ytestrunner is using a different module object for yuitest than what your tests are using. So it doesn't "see" any tests. That's why it says "No tests actually executed"

Please read the CAVEATS section in

ytestrunner is designed to be used as part of npm test in a way that the module loading of the YUITest module gives you the same object for both the test cases and the runner.

YUITest was written before nodejs became popular and it doesn't play well with local node_modules/ dependencies. ytestrunner is designed to correct that (although, as you can see, this correction is far from perfect).


Basically, this is the bottom line.

You should either have:

  1. both ytestrunner as well as yuitest globally installed and not have them as devDependencies in your package.json
  2. both of them as devDependencies in package.json and neither installed globally

Option (2) is preferred since these packages are clearly devDependencies, and give you the choice of having different versions of these libraries in different projects. In this case, you would use npm test to test your package and not the ytestrunner command directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 11, 2012
  1. @thiagocaiubi
Commits on Sep 17, 2012
  1. @thiagocaiubi

    Test scenario

    thiagocaiubi authored
This page is out of date. Refresh to see the latest.
BIN  examples/yuitest-sample/test/error-screen.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2  examples/yuitest-sample/test/foo.test.js
@@ -6,6 +6,6 @@ Y.TestRunner.add(new Y.TestCase({
name : 'Foo Test Case',
"should get correct value for foo": function () {
- Assert.areSame('foo', require('../lib/foo').getFoo());
+ Assert.areSame('wrong foo', require('../lib/foo').getFoo(), 'Something is wrong here and I will be omitted in you stdout!');
4 lib/base-test-runner.js
@@ -271,6 +271,10 @@ BaseTestRunner.prototype = {
if (that.saveResults) {
that.writeFile('test results', resultsFile, formatter(results));
+ if (data.error) {
+ log.logError(data.error);
+ }
} else {
console.log('Empty test results');
Something went wrong with that request. Please try again.