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

Test glob with parent directory #6398

Merged
merged 2 commits into from Oct 13, 2022

Conversation

sjarva
Copy link
Contributor

@sjarva sjarva commented Oct 8, 2022

Which issue, if any, is this issue related to?

Closes #3273

Is there anything in the PR that needs further explanation?

I think that these added unit tests should have been in __tests__/standalone-globs.test.js, but as the needed test case has to have the styles in a parent directory, and all unit tests have to be in __tests__, I created a new folder standalone-glob-parent-test that contains all the needed files.

I also created a unit test that has a parent directory (../) and a wildcard (**/) in the glob, since although this is not very common, it's a possible case. And as the documentation says that [the unit tests] should be comprehensive and systematic, I thought this is a valid test case to have.

@changeset-bot
Copy link

changeset-bot bot commented Oct 8, 2022

⚠️ No Changeset found

Latest commit: 21cfd87

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sjarva sjarva changed the title Fix glob parent directory bug Add glob unit tests with parent directory Oct 8, 2022
Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

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

@sjarva Thanks for opening the pull request. The added tests look good to me. 👍🏼

By the way, a linting job in CI fails. Could you fix it, please?

…') and paren + wildcard directory ('../**/style.css')
@sjarva sjarva force-pushed the fix/3273-parent-directory-glob branch from f2079e5 to 386a3fb Compare October 12, 2022 19:30
@sjarva
Copy link
Contributor Author

sjarva commented Oct 12, 2022

@sjarva Thanks for opening the pull request. The added tests look good to me. 👍🏼

By the way, a linting job in CI fails. Could you fix it, please?

Absolutely! I'm not totally sure did I fix it correctly, because the first time that I ran npm run format (to fix the prettier errors that the CI/CD pipeline), there was no changes that I could commit 🤔

I added the new test folder to .prettierignore, as has been done with other style files that are in /fixtures.

Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

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

Thank you. LGTM 👍🏼

@jeddy3 jeddy3 changed the title Add glob unit tests with parent directory Test glob with parent directory Oct 13, 2022
Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

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

Thank you!

@jeddy3 jeddy3 merged commit b24d34f into stylelint:main Oct 13, 2022
@sjarva sjarva deleted the fix/3273-parent-directory-glob branch October 13, 2022 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add tests for parent directory files input
3 participants