-
-
Notifications
You must be signed in to change notification settings - Fork 470
Added unit tests for basic configurations #176
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
Conversation
@ekulabuhov - This is no longer a required check and is not |
@ekulabuhov - one thing of note. If we are going to add tests and i'm all for it, best to do it in a way that is beneficial for all future pull requests.
|
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.
I would split the test utilities from test/basicText.js
to a file of their own. That will keep the tests easier to read.
Nice work overall. 👍
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.
Good changes. 👍
43e8ee5
to
e57de9d
Compare
@d3viant0ne I've tried moving webpack to peerDep but it didn't install it on Travis: https://travis-ci.org/ekulabuhov/style-loader/jobs/206042662 Other than that, I think I'm ok with merging this. |
Requires, the full travis file. I've commented out the bit's that will come with defaults but are outside the scope of this PR.
|
Added travis config Added mocha as devDep
@ekulabuhov - I've enabled |
|
@d3viant0ne - I've tried moving webpack to peerDependencies again. I can see it working in Travis (where it explicitly install it), but it fails when running mocha locally. Both NPM and yarn seem to ignore peerDependencies. Wouldn't it require each developer to install it manually? |
Moved web pack back from peerDep to dep Destructuring is not supported in Node v4.3, so replaced it
I know from experience that npm 2 will be problematic with |
At the moment we are only testing against a single version of webpack. We have the same issue in less-loader, |
Ah, yeah. I see your point now. Basically you want to test against multiple versions of webpack later on. That's a good separate problem to solve. |
Ok, thanks! Fixed Node v4 issues. Changed travis.yml from v4.3 to v4 to capture latest version of node. Got tests passing on all 3 versions. Good to go 👍 Should I squash it before merging? |
That was actually |
Ah, ok, didn't think about that. Reverted. Looked at css-loader and it's set to v4.7. |
Node v4: replaced "spread" operator with "apply"
I'll update it. At one point the minimum version was 4.7 ( long story ) |
@bebraw - Unless @ekulabuhov has something else he wants to add to this, i'd say ship it. Trying to kill that Codacy PR check with fire, for the time being just ignore it. |
I'm happy to merge this. But it will definately break: #122 |
Pull request validations > any code fix imo. Ship it :) |
👍 Nice work. |
👍 |
What kind of change does this PR introduce?
Build related change
Did you add tests for your changes?
Yes
If relevant, did you update the README?
Not relevant
Summary
This PR introduces unit testing setup we can use to check for regressions when adding new features to style-loader. Hopefully, this can provide a base for PR authors to test against.
The setup consists of:
Each test is running fully setup webpack compiler. This allows for great level of flexibility. Included are 5 tests for basic configurations shown in the Readme file.
Does this PR introduce a breaking change?
No
Other information