Skip to content

Feature: add option "serveIndex" to enable/disable serveIndex middleware #1752

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

Merged
merged 12 commits into from
Apr 5, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add (folder with index.html inside it) test case to serveIndex:true &…
… default
  • Loading branch information
EslamHiko committed Apr 5, 2019
commit 4c33da3269caa0590306103a42a40f27b94c62a3
8 changes: 8 additions & 0 deletions test/ContentBase.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ describe('ContentBase', () => {
it('should list the files inside the assets folder (200)', (done) => {
req.get('/assets/').expect(200, done);
});
Copy link
Member

Choose a reason for hiding this comment

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

Please add the following test here because it is confirmed in serveIndex:false.

    it('should show Heyo. because bar has index.html inside it (200)', (done) => {
      req.get('/bar/').expect(200, /Heyo/, done);
    });


it('should show Heyo. because bar has index.html inside it (200)', (done) => {
req.get('/bar/').expect(200, /Heyo/, done);
});
});
describe('test listing files in folders without index.html using the option serveIndex default (true)', () => {
beforeAll((done) => {
Expand All @@ -138,6 +142,10 @@ describe('ContentBase', () => {
it('should list the files inside the assets folder (200)', (done) => {
req.get('/assets/').expect(200, done);
});

it('should show Heyo. because bar has index.html inside it (200)', (done) => {
req.get('/bar/').expect(200, /Heyo/, done);
});
});
Copy link
Member

Choose a reason for hiding this comment

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

ditto

describe('to directories', () => {
beforeAll((done) => {
Expand Down