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

CLI should take multiple paths and not a glob pattern #44

Open
searls opened this issue Feb 18, 2019 · 6 comments
Open

CLI should take multiple paths and not a glob pattern #44

searls opened this issue Feb 18, 2019 · 6 comments

Comments

@searls
Copy link
Member

searls commented Feb 18, 2019

When invoked via the CLI, take paths like a normal unix app would, rather than ask users to provide globs in quotes.

This will probably be a breaking change demanding a major bump, but it's the right thing to do to make the cli behave conventionally

@searls
Copy link
Member Author

searls commented Feb 18, 2019

Related thing that this will likely close: #32

@jasonkarns
Copy link
Member

jasonkarns commented Aug 24, 2019

I'm not sold on this. node users in particular are conditioned to provide globs as arguments because expansion by the shell is not trustworthy or consistent [1] between the many environments of a teenytest suite (their various maintainers machines + at least one CI box).

[1] see globstar and that it is commonly either unavailable (due to old versions of bash) or, when available, it is off-by-default. Without globstar support (assuming we remove expansion by teenytest), it would not be possible to have teenytest run on subdirectories of a test directory.

@searls
Copy link
Member Author

searls commented Aug 25, 2019

@jasonkarns would you recommend any changes, then, to teenytest's behavior?

@jasonkarns
Copy link
Member

I think we should still implement #32, to take in multiple paths and/or globs, and simply expanding all of those args as if they were globs, flattening the resulting array. That would allow users to use shell globs if they are able, or to quote the globs and let teenytest expand them.

ie, i'd expect the following to all work:

teenytest test/**/*.test.js
teenytest 'test/**/*.test.js'
teenytest -- test/*.test.js
teenytest -- test/one.js:23 test/two.js:34

@searls
Copy link
Member Author

searls commented Aug 25, 2019

@jasonkarns I agree, I think. @cpruitt, are you on the same page as Jason?

related #45

@cpruitt
Copy link
Contributor

cpruitt commented Aug 26, 2019

@searls Yes, I agree with Jason. The work I've been doing while using Apple's default bash installation has bumped into the globstar issues he's is bringing up. I think treating all args as globs, even if they've already been expanded, is the most reliable way forward. If the user wants to use shell expansion then it would still work, but I'd be inclined to say that encouraging the use of glob strings over allowing the shell to expand globs would be a good thing to explain/encourage in documentation.

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

No branches or pull requests

3 participants