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

Refactor test #2632

Merged
merged 18 commits into from Apr 20, 2021
Merged

Refactor test #2632

merged 18 commits into from Apr 20, 2021

Conversation

alexander-akait
Copy link
Member

@alexander-akait alexander-akait commented Apr 15, 2021

What kind of change does this PR introduce?

refactor/tests

Did you add tests for your changes?

it is tests

If relevant, did you update the documentation?

No need

Summary

Part of #2573 to avoid big changes

Does this PR introduce a breaking change?

No

Other information

In future we should migrate on stdout and stderr snapshot tests everywhere, so feel free to send PRs with improve it, better do it by command, for build command by group of options, serve no need touch right now WIP on this

@codecov
Copy link

codecov bot commented Apr 15, 2021

Codecov Report

Merging #2632 (b4ef376) into master (39f7c97) will decrease coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2632      +/-   ##
==========================================
- Coverage   95.21%   95.14%   -0.07%     
==========================================
  Files          30       30              
  Lines        1505     1505              
  Branches      430      430              
==========================================
- Hits         1433     1432       -1     
- Misses         72       73       +1     
Impacted Files Coverage Δ
packages/webpack-cli/lib/plugins/CLIPlugin.js 100.00% <ø> (ø)
packages/webpack-cli/lib/webpack-cli.js 96.06% <100.00%> (-0.12%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 39f7c97...b4ef376. Read the comment docs.

snitin315
snitin315 previously approved these changes Apr 16, 2021
@alexander-akait
Copy link
Member Author

We need search way to say commander use unlimited width for our tests

@anshumanv
Copy link
Member

can you clarify?

@alexander-akait
Copy link
Member Author

https://github.com/tj/commander.js/blob/master/index.js#L577 in our tests on some os we have true on other false, so snapshots are different due width of tty

@@ -1023,7 +1023,7 @@ class WebpackCLI {
},
formatHelp: (command, helper) => {
const termWidth = helper.padWidth(command, helper);
const helpWidth = helper.helpWidth || 80;
const helpWidth = helper.helpWidth || process.env.WEBPACK_CLI_HELP_WIDTH || 80;
Copy link
Member Author

Choose a reason for hiding this comment

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

For testing purpose and for edge case where developer can set width of TTY

Copy link
Member

Choose a reason for hiding this comment

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

@alexander-akait
Copy link
Member Author

Finally, I'll do a couple PRs for tests, improve them

@alexander-akait alexander-akait merged commit 26ae685 into master Apr 20, 2021
@alexander-akait alexander-akait deleted the refactor-test branch April 20, 2021 18:28
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

4 participants