-
Notifications
You must be signed in to change notification settings - Fork 145
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
Jasmine example shows no cli output #88
Comments
On further investigation, it looks like I need to specify a reporter. Well an exit code reporter seems to be default and bash Might it be worth mentioning this in the README/docs? I feel like people might expect to see command line output when they're getting started running the example tests. |
Does jasmine ship with a terminal reporter? |
Was seeing results until the latest version. Now doesn't report anything. Rolling back to 2.4.1 reports results as expected. Looking around and not seeing how I add a custom reporter either as a CLI flag or in the |
Hmm, not exactly sure why this is happening off the top of my head. Looks like a Ultimately it shows up here: https://github.com/jasmine/jasmine/blob/master/src/core/ReportDispatcher.js If this dispatch happens after we call |
I have also a similar problem and I think this is because now in the 2.5.0 version, the configureDefaultReporter is always called and defaultReporterAdded will always be true and will enter this branch exiting the process. The |
Is there a workaround for this bug until a new jasmine is published? |
This is our workaround until the bug in jasmine 2.5.0 gets fixed.
This is still broken for everyone that has "jasmine": "^2.4.1" and "jasmine": "^2" in there package.json, They will get 2.5.0 on next fresh npm install and experience this issue. Are you going to publish 2.5.1 with this fix ? |
Fix should be released in 2.5.1 |
As explained in #90, it still does not work with 2.5.1. |
yes, still does not work in 2.5.1. Please reopen, otherwise new issues will be reported |
Hey, The fix that I applied for this issue, unfortunately, does not work for the defaultReporter. It is working for third-parties reporter, it was the same problem like in #43. How @bcaudan pointed out in #90 the problem is:
|
Jasmine cli does not hang in v2.5.1 as it used to be in v2.5.0, but still no jasmine report output in the command line in v2.5.1. @slackersoft Could you explain how to get the console reporter to work as it used to be in v2.4.1? If this is dropped in favor of 'exitCodeReporter', then how to get the 'consoleReporter' working again??? |
I'm moving back to version 2.4.1 until this is resolved
|
For a quick solution, you can drop in a
Moral of the story: if you have pluggable output modules, be nice and warn if there's no output hooked up at all, before people waste an hour or two each debugging mysteries. |
I just got bit by this. This issue is still breaking everyone with jasmine: "^2.4.1" In their package.json. |
Thanks alot @unconed. Your solution works! Now I get this output: ConsoleReporter is deprecated and will be removed in a future version. Started
....................
20 specs, 0 failures
Finished in 0 seconds But notice the first line says ConsoleReporter |
It sounds like this wasn't actually fixed as I thought it was with the 2.5.1 release. Hopefully, I should have some time today to take a look at it and see what the problem is. The intent of the reporter changes was to remove the need for a custom reporter to have to tell Jasmine about full success/fail of the test run and just print the output that it wants. |
See relevant pr for more information.
@slackersoft and people of this thread. Here's some light at the end of the tunnel: jasmine/jasmine#1208 |
Alrighty, I think I know what happened here and what the problem is, and I have a workaround for now and some options I'm mulling over for real fixes. First, why this is happening:
If you want to keep use the most current var jasmineNpm = require('jasmine');
jasmine.getEnv().addReporter(new jasmineNpm.ConsoleReporter(...)); The two primary options I'm thinking of for long-term solutions are:
I would love to hear any thoughts on these solutions or any suggestions for another way to solve this. Thanks for your patience, and sorry for the premature closing earlier. |
@slackersoft In your first solution, would the The second solution also sounds appealing to me, in that it's non intrusive and that it might actually be useful for my test runner, but could be misleading if the reported count is not requested immediately before the execution. So maybe it would be worth it to make this very clear in the docs, or designate a flag in the |
Due to the direction of the dependency chain, it would be hard to sensibly allow jasmine-core to know specifically about the The second option probably wouldn't include any way to fail if a reporter was added after another given reporter, so it would just be up to jasmine-npm to add I'm leaning toward the second option because it is a bit less involved, but it also seems to remove the need for a fallback reporter at all... |
It seems to me like this is kind of backwards to begin with. Shouldn't jasmine-core contain and use the ExitCodeReporter by default if no other reporter exists, and jasmine-npm can set the ConsoleReporter? |
Jasmine-npm is the only Jasmine runner that I know of that it makes sense to have a direct exit code produced from the run. Most other runners for Jasmine are intended for use in the browser where having an exit code is nonsensical. |
So instead of setting the ConsoleReporter as a FALLBACK in jasmine-npm why don't you just set both reporters? addReporter(new ConsoleReporter(...))
addReporter(new ExitCodeReporter(...)) |
@th317erd Causing conflicts with other reporters would be one reason not to do that. |
@th317erd because if jasmine-npm always registers its |
I proposed another way to solve this with #92. It seems a bit odd to handle exit code with a reporter but it was working for now. With a way to handle an env execution callback in jasmine, then ExitCodeReporter could be replaced by a jasmine-npm default onComplete callback. This callback could be overriden by the existing onComplete option. Then jasmine-npm would only provide the console reporter as a fallback reporter. maybe I am missing something, what do you think of this strategy? |
@slackersoft |
Thanks @slackersoft |
The underlying issue ([jasmine-npm#88][1]) was fixed in v2.5.2 (with [a87cdad][2]). [1]: jasmine/jasmine-npm#88 [2]: jasmine/jasmine-npm@a87cdad
The underlying issue ([jasmine-npm#88][1]) was fixed in v2.5.2 (with [a87cdad][2]). [1]: jasmine/jasmine-npm#88 [2]: jasmine/jasmine-npm@a87cdad
The underlying issue ([jasmine-npm#88][1]) was fixed in v2.5.2 (with [a87cdad][2]). [1]: jasmine/jasmine-npm#88 [2]: jasmine/jasmine-npm@a87cdad
I followed everything here in the README of this repo, but I get no output on the cli when I run
jasmine
. I must be missing something obvious.which jasmine
shows./node_modules/.bin/jasmine
which is in my project dir.I run with explicit locations and get the same result:
JASMINE_CONFIG_PATH=spec/support/jasmine.json jasmine spec/jasmine_examples/PlayerSpec.js
By no output I mean:
prompt>$jasmine
prompt>$
Any ideas?
The text was updated successfully, but these errors were encountered: