websocket快速操作工具
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

30 lines
780 B

var request = require('supertest');
var path = require('path');
var liveServer = require('..').start({
root: path.join(__dirname, "data"),
port: 0,
open: false,
mount: [
[ "/mounted", path.join(__dirname, "data", "sub") ],
[ "/style", path.join(__dirname, "data", "style.css") ]
]
});
describe('mount tests', function() {
it('should respond with sub.html', function(done) {
request(liveServer)
.get('/mounted/sub.html')
.expect('Content-Type', 'text/html; charset=UTF-8')
.expect(/Subdirectory/i)
.expect(200, done);
});
it('should respond with style.css', function(done) {
request(liveServer)
.get('/style')
.expect('Content-Type', 'text/css; charset=UTF-8')
.expect(/color/i)
.expect(200, done);
});
});