Allow also files starting with dot in express - #74
Conversation
56db9e6 to
53dc755
Compare
sgravrock
left a comment
There was a problem hiding this comment.
There's a closely related problem: By default, glob only matches dot files/dirs if they're explicitly named in the glob expression. So this causes spec/.dotFolder/specFile.js to be included in the index page:
"specDir": "specs",
"specFiles": [".dotFolder/*.js"],
But this doesn't:
"specDir": "specs",
"specFiles": ["**/*.js"],
That's a big part of why I had trouble reproducing the behavior you saw: I didn't think of the specific scenario where glob matches the file but Express doesn't serve it.
I think that needs to be addressed along with the Express change. Otherwise it would be hard for users to understand which dotfiles will and won't be included.
| expect(html).toContain('/__support__/batchReporter.js'); | ||
| }); | ||
|
|
||
| it('loads spec and helper files with starting dots in their names', async function() { |
There was a problem hiding this comment.
This test passes even if I revert the non-test changes.
There are two aspects to making files with leading dots in their paths work:
- Including a link to the file in index.html, which is what this test checks. That already worked, at least for this specific configuration (but see my other comment.)
- Making Express serve that file instead of a 404, which is what the functional changes in this PR address. This test doesn't verify that.
fixes #73