-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Removed unused code in mini reporter #1169
Removed unused code in mini reporter #1169
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
var reporter = miniReporter(); | ||
reporter.failCount = 2; | ||
|
||
var err1 = new Error('failure one'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just err
?
compareLineOutput.SKIP_UNTIL_EMPTY_LINE, | ||
'', | ||
'' | ||
].concat( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=> .concat(expectedStack.split('\n'))
var output = reporter.finish(runStatus); | ||
|
||
var expectedStack = colors.error(' failure two\n') + colors.errorStack('stack line with trailing whitespace'); | ||
expectedStack = expectedStack.split('\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this and see comment below.
err1.stack = beautifyStack(err1.stack); | ||
|
||
var runStatus = { | ||
errors: [{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be:
errors: [
{title: 'failed one', error: err},
{title: 'failed two'}
]
…vior is still the same
37b46e4
to
d78f63c
Compare
@vadimdemedes all good suggestions for improvements, I have updated the pull request. |
Thank you, @jarlehansen! |
This PR increases code coverage #161 in mini-reporter by removing unused code and added a new test to verify the behaviour.
The removed if-statement seems to be unnecessary because the same value is check in the beginning of the function.