Skip to content

Comments

add basic directory tests#80

Merged
SuperchupuDev merged 1 commit intoSuperchupuDev:mainfrom
webpro:feat/single-star-for-directories
Feb 15, 2025
Merged

add basic directory tests#80
SuperchupuDev merged 1 commit intoSuperchupuDev:mainfrom
webpro:feat/single-star-for-directories

Conversation

@webpro
Copy link
Contributor

@webpro webpro commented Dec 16, 2024

When trying out tinyglobby, I noticed it doesn't return directories the way I'd expect. So I wonder whether using the single star like this is invalid syntax and expected behavior. Is there a way with different syntax and/or options to make the tests pass already?

Or should we try and make this happen? :)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 17, 2024

Open in Stackblitz

npm i https://pkg.pr.new/tinyglobby@80

commit: 5fcc9c5

@SuperchupuDev
Copy link
Owner

it's expected if it matches fast-glob. if it doesn't let me know and i'll fix it :)

@webpro
Copy link
Contributor Author

webpro commented Dec 17, 2024

I think the tests should pass when using onlyDirectories, fast-glob does this too:

My observations only consider directories, but should align for onlyFiles:

Also note that fast-glob does not suffix directories with /, whereas tinyglobby does. Personally I can appreciate tinyglobby's behavior, but it's good to know there's a diff.

@SuperchupuDev
Copy link
Owner

SuperchupuDev commented Dec 18, 2024

tested, it's a regression on main (works on 0.2.10). thanks for reporting! would have been chaotic if this bug made its way into a release

@SuperchupuDev
Copy link
Owner

SuperchupuDev commented Dec 18, 2024

looks like the bug isn't present in #76, so should be fixed once that gets merged

@webpro
Copy link
Contributor Author

webpro commented Dec 18, 2024

Splendid! Perhaps good to have tests to prevent regressions, the ones in this PR or others.

Let me know, I'd be happy to refactor or add more. Or close this PR.

@SuperchupuDev
Copy link
Owner

yep, will merge this once the bug is fixed :) can you refactor them so that they don't create a new fixture? should be possible to use the already created one

@webpro webpro force-pushed the feat/single-star-for-directories branch from 7adc53d to 882e3c7 Compare December 18, 2024 15:20
@webpro
Copy link
Contributor Author

webpro commented Dec 18, 2024

of course!

@SuperchupuDev
Copy link
Owner

@webpro #76 was just merged which should make the tests introduced here pass. can you rebase with the new changes from main?

@webpro webpro force-pushed the feat/single-star-for-directories branch from 882e3c7 to 5fcc9c5 Compare February 15, 2025 09:25
@webpro webpro marked this pull request as ready for review February 15, 2025 09:25
@webpro
Copy link
Contributor Author

webpro commented Feb 15, 2025

alright i did the thing :)

@SuperchupuDev SuperchupuDev changed the title How to query directories? add basic directory tests Feb 15, 2025
Copy link
Owner

@SuperchupuDev SuperchupuDev 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!!!

@SuperchupuDev SuperchupuDev merged commit 857d78b into SuperchupuDev:main Feb 15, 2025
6 checks passed
@webpro webpro deleted the feat/single-star-for-directories branch February 15, 2025 16:43
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.

2 participants