Skip to content

fix: improve messaging for force ignore old vs new parsers #324

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

Merged
merged 7 commits into from
May 18, 2021

Conversation

peternhale
Copy link
Contributor

What does this PR do?

Improves the user messaging around old and new parsers used to parse foriceignore files

What issues does this PR fix or reference?

@W-9051899@

Functionality Before

Message displayed to user was a bit confusing, just providing a better message and reducing the number of diffs displayed

Functionality After

Better message

@peternhale peternhale requested a review from a team as a code owner April 23, 2021 18:02
@@ -23,6 +23,35 @@ describe('ForceIgnore', () => {

afterEach(() => env.restore());

(!process.platform.includes('win') ? it : it.skip)(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@brpowell I skipped this one test for windows. Having no luck with the stubs working. Not sure why, but would appreciate any ideas.

Copy link
Contributor

Choose a reason for hiding this comment

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

Will it not work even with the wrapping of process.emitWarning in ForceIgnore? I don't want to skip tests based on platform, especially windows.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@brpowell even when wrapped. My first attempt was to stub process.emitWarning, no joy. Then wrap with private function. I agree that skipping tests is a bad idea, esp for windows.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can take a closer look at what's going wrong, likely not until tomorrow or next week though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@brpowell Thanks

@peternhale
Copy link
Contributor Author

@brpowell Just checking if you have had a chance to look at the mock trouble I am having with the one test on windows?

@shetzel
Copy link
Contributor

shetzel commented May 15, 2021

@peternhale @brpowell - the stubs for the 2 libraries used in the resolveConflict function were not actually doing anything, so the test was relying on actual behavior which differed between platforms. Changing the stub slightly ensures the test condition we're trying to create so now it passes on linux and windows.

@peternhale
Copy link
Contributor Author

@brpowell Could I get a review on this. Steve fixed the windows test, so I think we are good to go on this PR.

@peternhale peternhale merged commit 158e97a into develop May 18, 2021
@peternhale peternhale deleted the phale/W-9051899-5 branch May 18, 2021 14:38
AnanyaJha pushed a commit that referenced this pull request May 24, 2021
* fix: improve messaging for force ignore old vs new parsers

@W-9051899@

* chore: get more details on test failure

* chore: add private cover for process.emitWarning

Doing this for widnows

* chore: skip on windows

* test: update test to stub properly for the usecase

Co-authored-by: Steve Hetzel <shetzel@salesforce.com>
Co-authored-by: Bryan Powell <b.powell@salesforce.com>
AnanyaJha pushed a commit that referenced this pull request May 24, 2021
* fix: improve messaging for force ignore old vs new parsers

@W-9051899@

* chore: get more details on test failure

* chore: add private cover for process.emitWarning

Doing this for widnows

* chore: skip on windows

* test: update test to stub properly for the usecase

Co-authored-by: Steve Hetzel <shetzel@salesforce.com>
Co-authored-by: Bryan Powell <b.powell@salesforce.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants