Skip to content

Print test errors when they exists #3

Open
wants to merge 2 commits into from

2 participants

@thiagocaiubi

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

@gotwarlost
Owner

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!

@gotwarlost
Owner

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:

https://github.com/chaordic/ytestrunner/blob/a36ad3858104412f8d782cbd651bcb928f489f59/lib/cli.js#L395

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?

@thiagocaiubi

For some reason the output for me is this one:

chaordic@9a7fd46

I will investigate in more details soon.

Thanks!

@gotwarlost
Owner

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 README.md.

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).

@gotwarlost
Owner

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
Something went wrong with that request. Please try again.