var request = require('supertest'); var path = require('path'); var liveServer = require('..').start({ root: path.join(__dirname, "data"), port: 0, open: false }); describe('basic functional tests', function(){ it('should respond with index.html', function(done){ request(liveServer) .get('/') .expect('Content-Type', 'text/html; charset=UTF-8') .expect(/hello world/i) .expect(200, done); }); it('should have injected script', function(done){ request(liveServer) .get('/') .expect('Content-Type', 'text/html; charset=UTF-8') .expect(/