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

Simplify check hasDependencies and add unit tests #6346

Merged
merged 5 commits into from Jun 28, 2018

Conversation

Connormiha
Copy link
Member

What kind of change does this PR introduce?
Added unit tests + minor refactoring

Did you add tests for your changes?
Yes

Summary
Added different test cases for hasDependencies.
Simplify mehod.

Does this PR introduce a breaking change?
No

@ooflorent
Copy link
Member

@Connormiha you could ignore the failure.

@sokra
Copy link
Member

sokra commented Jan 21, 2018

Unit tests do not contribute to test coverage. To test this add an integration test which covers this scenario.

@Connormiha
Copy link
Member Author

@sokra
It is very strange that the code coverage has decreased. I just cut a few strings (I did't add new features).

} else {
if(this.dependencies.length > 0) return true;
return this.dependencies.length > 0;

Choose a reason for hiding this comment

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

You can omit else block and just type this statement on the end of the function

@Connormiha
Copy link
Member Author

@ooflorent should i do something else to avoid CI warnings at this PR( i think these were falsely warnings)?

@ooflorent
Copy link
Member

ooflorent commented Jan 27, 2018

@Connormiha the warning is fine. I've removed it.

EDIT: Grr.

@sokra sokra changed the base branch from next to master February 13, 2018 12:00
@sokra sokra removed the PR: next label Feb 13, 2018
@webpack-bot
Copy link
Contributor

@Connormiha Thanks for your update.

I labeled the Pull Request so reviewers will review it again.

@sokra Please review the new changes.

@webpack-bot
Copy link
Contributor

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@webpack-bot
Copy link
Contributor

webpack-bot commented May 15, 2018

For maintainers only:

  • This need to be documented (issue in webpack/webpack.js.org will be filed when merged)

# Conflicts:
#	test/DependenciesBlockVariable.unittest.js
@sokra sokra force-pushed the simplife-has-dependencies branch from 2f73628 to dddb547 Compare May 28, 2018 09:04
@webpack-bot
Copy link
Contributor

It looks like this Pull Request doesn't include enough test cases (based on Code Coverage analysis of the PR diff).

A PR need to be covered by tests if you add a new feature (we want to make sure that your feature is working) or if you fix a bug (we want to make sure that we don't run into a regression in future).

@Connormiha Please check if this is appliable to your PR and if you can add more test cases.

Read the test readme for details how to write test cases.

@sokra sokra merged commit b848ec5 into webpack:master Jun 28, 2018
@sokra
Copy link
Member

sokra commented Jun 28, 2018

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants