mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
fix(route) buildIndex: no index.html
This commit is contained in:
parent
d2229e965a
commit
4808a18305
2 changed files with 26 additions and 5 deletions
|
|
@ -1,5 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const test = require('tape');
|
||||
const promisify = require('es6-promisify');
|
||||
const pullout = require('pullout');
|
||||
|
|
@ -101,3 +102,24 @@ test('cloudcmd: route: buttons: no contact', (t) => {
|
|||
});
|
||||
});
|
||||
|
||||
test('cloudcmd: route: no index', (t) => {
|
||||
const name = path.join(__dirname, '../../dist-dev/index.html');
|
||||
const nameAfter = path.join(__dirname, '../../dist-dev/index1.html');
|
||||
|
||||
const fs = require('fs');
|
||||
|
||||
fs.renameSync(name, nameAfter);
|
||||
|
||||
const before = require('../before');
|
||||
|
||||
before({}, (port, after) => {
|
||||
getStr(`http://localhost:${port}/`)
|
||||
.then((result) => {
|
||||
fs.renameSync(nameAfter, name);
|
||||
t.equal(result.indexOf('ENOENT'), 0, 'should not found index.html');
|
||||
t.end();
|
||||
after();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue