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

Glob expansion in shell prevents running all intended tests #31

Closed
Schoonology opened this issue Oct 6, 2017 · 8 comments
Closed

Glob expansion in shell prevents running all intended tests #31

Schoonology opened this issue Oct 6, 2017 · 8 comments

Comments

@Schoonology
Copy link

If you run teenytest test/**/*.js in a terminal, the shell will expand that glob automatically, and the argvOptions function will pull the first from that list to run. This is surprising, though there's a workaround: prevent shell expansion with single quotes: teenytest 'test/**/*.js'. This allows the prepare function to expand the glob as intended.

@Schoonology
Copy link
Author

More throwing this here to keep track of it; it looks like more of a fix than I have time for this morning.

@searls
Copy link
Member

searls commented Oct 6, 2017

Yes! (I believe the same is true for double-quoting in, at least, bash)

Is there an action to be taken in this issue?

@searls
Copy link
Member

searls commented Oct 6, 2017

In general, IME, there's not much a CLI can do if the shell has expanded the arg before the receiving program runs and is provided ARGV, so I think this ticket is probably a no-op aside from scanning documentation?

@Schoonology
Copy link
Author

Do we expect teenytest to take other kinds of positional arguments, or could we accept any number of files or patterns from argv? If we do that, it doesn't matter where expansion happens.

@searls
Copy link
Member

searls commented Oct 6, 2017

Can you give an example of what ARGV looks like after your shell has expanded it? My understanding is it'll often just be the first match, as opposed to something like an array of lots of items.

To answer your question more directly: teenytest currently only supports a single pattern of test files. I'd love if it accepted multiple globs (and exclude patterns), though!

@Schoonology
Copy link
Author

Instead of ['test/**/*.js'], you get an array: ['test/lib/parser.js', 'test/integration/index.js'].

@searls
Copy link
Member

searls commented Oct 6, 2017

Cool, in that case "supporting multiple globs" should fix this on its own one would think

@searls
Copy link
Member

searls commented Oct 6, 2017

Let's track this in #32

@searls searls closed this as completed Oct 6, 2017
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

2 participants