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

Add no-nested-tests rule #109

Merged
merged 1 commit into from
Oct 12, 2016
Merged

Add no-nested-tests rule #109

merged 1 commit into from
Oct 12, 2016

Conversation

lo1tuma
Copy link
Owner

@lo1tuma lo1tuma commented Oct 6, 2016

fixes #108

Copy link
Collaborator

@jfmengels jfmengels left a comment

Choose a reason for hiding this comment

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

I wrote one tip, but looks good to me otherwise :)
(do you update the changelog when releasing?)

var testNestingLevel = 0;

function report(callExpression) {
var message = astUtils.isTestCase(callExpression) ? 'Unexpected test nested within another test.' :
Copy link
Collaborator

Choose a reason for hiding this comment

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

slight boost, you call have an argument isTestCase for this function, as you have already computed in the calling function.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Good hint 👍
Done 😉

@lo1tuma
Copy link
Owner Author

lo1tuma commented Oct 6, 2016

do you update the changelog when releasing?

Yes. When doing a release I run npm run changelog <version-number> to generate the changelog based on the titles of closed PRs since the last release.

@lo1tuma lo1tuma merged commit 7d0d872 into master Oct 12, 2016
@lo1tuma lo1tuma deleted the no-nested-tests branch October 12, 2016 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule proposal: no-nested-its
2 participants