Skip to content

Allow also files starting with dot in express - #74

Open
HolgerJeromin wants to merge 1 commit into
jasmine:mainfrom
HolgerJeromin:expressDotFiles
Open

Allow also files starting with dot in express#74
HolgerJeromin wants to merge 1 commit into
jasmine:mainfrom
HolgerJeromin:expressDotFiles

Conversation

@HolgerJeromin

Copy link
Copy Markdown
Contributor

fixes #73

@sgravrock sgravrock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread spec/serverSpec.js
expect(html).toContain('/__support__/batchReporter.js');
});

it('loads spec and helper files with starting dots in their names', async function() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

dot files with source and spec file paths

2 participants