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

Project base dirs containing special Glob syntax don't work #206

Closed
MumblingFumbler opened this issue Apr 21, 2023 · 1 comment
Closed

Comments

@MumblingFumbler
Copy link

Feature Proposal

Support square brackets ('[' and ']') and all possible Windows path characters in Jasmine
The project path [Jasmine Sandbox] is a legitimate windows folder name.
But if [Jasmine Sandbox] appears in a project path, jasmine will not be able to find spec files, and jasmine reports
No specs found
Finished in 0.001 seconds
Incomplete: No specs found
even if there are specs in the specs folder.
If you aren't going to fix it, at least report an error indicating that jasmine doesn't like the path, and what it doesn't like about it.
Are legitimate and invalid path characters documented anywhere? It looks like spaces in paths are handled correctly.

Context

I wouldn't have had to spend several hours trying to figure out why my spec files were not being found.

Example

No response

Other Information

No response

@sgravrock sgravrock transferred this issue from jasmine/jasmine Apr 22, 2023
@sgravrock
Copy link
Member

It sounds to me like you think that Jasmine intentionally filters out paths containing square brackets, and that this means that Windows paths aren't supported.

Here's what actually happened: You ran into an obscure bug involving the interaction between jasmine, glob, and certain specific sequences of characters in the project base directory. The bug has been there since the very first commit of the jasmine package's code back in 2014, and it's not Windows specific. Nobody knew about it until now, or at least nobody reported it.

The issue is that fields like spec_files are evaluated by concatenting them with the project base directory and passing the result to glob. As a result, project paths containing special glob syntax don't work. In this case, the sequence [Jasmine Sandbox] gets evaluated as a regex style character class. Since the literal string [Jasmine Sandbox] doesn't match the character class [Jasmine Sandbox], the glob result doesn't include any files. This could probably be fixed by passing the project base directory to glob separately rather than concatenating it.

@sgravrock sgravrock changed the title Support Windows paths for Windows version of jasmine Project base dirs containing special Glob syntax don't work Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants