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

Fix setOptions to the ConsoleReporter if it exists on the options param #98

Merged
merged 1 commit into from
Dec 2, 2016

Conversation

cnishina
Copy link
Contributor

@cnishina cnishina commented Oct 28, 2016

  • move default values for setOptions to the var when defined
  • setOptions to the ConsoleReporter if it exists on the options param
  • test setOptions should not override existing options if set multiple times

closes #95

@cnishina
Copy link
Contributor Author

cnishina commented Nov 7, 2016

@slackersoft could you review this for me? Thanks!

@slackersoft
Copy link
Member

slackersoft commented Nov 8, 2016

I don't think this is quite what we want to solve this issue. The thing we would want, is to only call configureDefaultReporter if it has not already been called. It looks like the reportersCount variable should also be deleted at some point since it isn't used.

Additionally, you have not provided any tests for your functionality. Please review and update this pull request or create a new one to address these issues. Thanks for using Jasmine!

@cnishina
Copy link
Contributor Author

cnishina commented Nov 8, 2016

Good point. Looking at this more, I'll have a fix and some tests. I'll ping you again when I have everything completed.

@cnishina cnishina changed the title fix - prevent execute method from overriding configureDefaultReporter Fix setOptions to the ConsoleReporter if it exists on the options param Nov 8, 2016
@cnishina cnishina force-pushed the fix_defaultreporter branch 2 times, most recently from e5cfb1e to 2ae4cb6 Compare November 8, 2016 07:08
@cnishina
Copy link
Contributor Author

cnishina commented Nov 8, 2016

@slackersoft It looks like ConsoleReporter setOptions was overriding previous values such as print so I made the changes there and have included a test. I checked the test in comparison to the previous version with setOptions and it would report an error with print is not a function.

I reverted back removing Jasmine.prototype.provideFallbackReporter since it did not appear to be used. If this makes sense, I'll could put together a PR to remove that and reportersCount.

@cnishina
Copy link
Contributor Author

@slackersoft pinging again for review. Thanks!

@@ -10,7 +10,7 @@ function ConsoleReporter() {
showColors = false,
timer = noopTimer,
jasmineCorePath = null,
printDeprecation = function() {},
printDeprecation = require('../printDeprecation'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're actually doing this in the previous manner so that no deprecation errors are printed out during specs. This also allows the specs not not have to pass in a custom no-op printDeprecation if that particular spec isn't concerned with the deprecated functionality.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted printDeprecation to be a no-op.

- setOptions to the ConsoleReporter if it exists on the options param
- test setOptions should not override existing options if set multiple times

closes jasmine#95
@slackersoft slackersoft merged commit 1d51773 into jasmine:master Dec 2, 2016
slackersoft pushed a commit that referenced this pull request Dec 2, 2016
@cnishina
Copy link
Contributor Author

cnishina commented Dec 2, 2016

@slackersoft Thanks!

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.

configureDefaultReporter() options are lost
2 participants