Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 16 additions & 0 deletions test/tests/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ describe('Server', () => {
listen = listenShorthand(done);
// Hack to add a mock HMR json file to the in-memory filesystem.
instance.fileSystem.writeFileSync('/123a123412.hot-update.json', '["hi"]');

// Add a nested directory and index.html inside
instance.fileSystem.mkdirSync('/reference');
instance.fileSystem.mkdirSync('/reference/mono-v6.x.x');
instance.fileSystem.writeFileSync(
'/reference/mono-v6.x.x/index.html',
'My Index.'
);
});

after(close);
Expand Down Expand Up @@ -103,6 +111,14 @@ describe('Server', () => {
.expect(200, /My Index\./, done);
});

it('request to subdirectory without trailing slash', (done) => {
request(app)
.get('/public/reference/mono-v6.x.x')
.expect('Content-Type', 'text/html; charset=UTF-8')
.expect('Content-Length', '9')
.expect(200, /My Index\./, done);
});

it('invalid range header', (done) => {
request(app).get('/public/svg.svg')
.set('Range', 'bytes=6000-')
Expand Down
6 changes: 6 additions & 0 deletions test/tests/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,12 @@ describe('GetFilenameFromUrl', () => {
outputPath: '/test/#leadinghash',
publicPath: '/',
expected: '/test/#leadinghash/test/sample.txt'
},
{
url: '/folder-name-with-dots/mono-v6.x.x',
outputPath: '/',
publicPath: '/',
expected: '/folder-name-with-dots/mono-v6.x.x'
}
];

Expand Down