Skip to content

Commit

Permalink
Renamed www test, added stderr stream
Browse files Browse the repository at this point in the history
  • Loading branch information
sgress454 committed Dec 30, 2014
1 parent 97861aa commit 4576688
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/integration/www.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var spawn = require('child_process').spawn;
// Make existsSync not crash on older versions of Node
fs.existsSync = fs.existsSync || require('path').existsSync;

describe('Starting sails server with lift', function() {
describe('Running sails www', function() {
var sailsBin = './bin/sails.js';
var appName = 'testApp';
var sailsServer;
Expand Down Expand Up @@ -43,19 +43,22 @@ describe('Starting sails server with lift', function() {

});

describe('in an sails app directory', function() {
describe('in a sails app directory', function() {

it('should start server without error', function(done) {

exec(sailsBin + ' new ' + appName, function(err) {
if (err) done(new Error(err));

// Move into app directory
process.chdir(appName);
sailsBin = '.' + sailsBin;

sailsServer = spawn(sailsBin, ['www']);

sailsServer.stderr.on('data', function (data) {
return done(data);
});

sailsServer.stdout.on('data', function(data) {
var dataString = data + '';
assert(dataString.indexOf('error') === -1);
Expand Down

0 comments on commit 4576688

Please sign in to comment.