mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
test(route) symlink-dir: autocreate
This commit is contained in:
parent
c039fae343
commit
752020de1a
2 changed files with 8 additions and 3 deletions
|
|
@ -1 +0,0 @@
|
|||
empty-dir
|
||||
|
|
@ -137,15 +137,21 @@ test('cloudcmd: route: file', (t) => {
|
|||
});
|
||||
|
||||
test('cloudcmd: route: symlink', (t) => {
|
||||
const root = path.join(__dirname, '..', 'fixture', 'symlink-dir');
|
||||
const emptyDir = path.join(__dirname, '..', 'fixture', 'empty-dir');
|
||||
const root = path.join(__dirname, '..', 'fixture');
|
||||
const symlink = path.join(root, 'symlink-dir');
|
||||
|
||||
const config = {
|
||||
root,
|
||||
};
|
||||
|
||||
fs.symlinkSync(emptyDir, symlink);
|
||||
|
||||
before({config}, (port, after) => {
|
||||
getStr(`http://localhost:${port}/fs/`)
|
||||
getStr(`http://localhost:${port}/fs/symlink-dir`)
|
||||
.then((empty) => {
|
||||
t.ok(empty.length, 'should return html document');
|
||||
fs.unlinkSync(symlink);
|
||||
t.end();
|
||||
after();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue