tests: add test for zero config#1418
Conversation
alexander-akait
left a comment
There was a problem hiding this comment.
Couple extra test, anyway good job!
alexander-akait
left a comment
There was a problem hiding this comment.
Can we add test when entry point exists, but webpack.config.js no?
| // Should be able to find the entry file | ||
| expect(stdout).toContain('./src/index.js'); | ||
| // Should output at the default output dir and filename | ||
| expect(stdout).toContain('Entrypoint main = main.js'); |
There was a problem hiding this comment.
We already have it, only entry present and config absent. @evilebottnawi
|
Can you provide here structure what we generate on init by default? |
|
on init? as in? |
|
The default config you mean? |
|
@anshumanv |
init tests are here - #1419 |
|
@anshumanv Feel free to merge after CI was green |
|
Cool, need another review then I'll merge once green. 👍 |
rishabh3112
left a comment
There was a problem hiding this comment.
Looks good to me, just one suggestion.
| const { run } = require('../../utils/test-utils'); | ||
|
|
||
| describe('Zero Config tests', () => { | ||
| it('runs when no config is supplied but entry is present', () => { |
There was a problem hiding this comment.
We could also test for existence of bundle output file.
There was a problem hiding this comment.
We can def do that, thinking if this would be the right scope for it as output file check is something which is config/flag agnostic. wdyt? Since we're not checking for it anywhere else, should be also checked for it in all other tests?
There was a problem hiding this comment.
Or maybe we can just check the test util since it's used everywhere, will add tests for the run fn that we use in all tests separately. Would make more sense to check file existence there.
There was a problem hiding this comment.
In this particular case we should test it either way imo. Because the test is for checking whether without config we are bundling or not.
Tests for run as well in a different PR would be great :)
There was a problem hiding this comment.
Or maybe we can just check the test util since it's used everywhere, will add tests for the
runfn that we use in all tests separately. Would make more sense to check file existence there.
We're consuming the run fn for couple of test cases where bundle output is not generated, say the migrate command. It should be taken into account while writing the respective tests.
There was a problem hiding this comment.
Sounds fair, added. 👍
|
@anshumanv Thanks for your update. I labeled the Pull Request so reviewers will review it again. @rishabh3112 Please review the new changes. |
What kind of change does this PR introduce?
tests
Did you add tests for your changes?
Yes
If relevant, did you update the documentation?
NA
Summary
Does this PR introduce a breaking change?
No
Other information