Files
archived-nodemon/test/fork/config.test.js
Remy Sharp 2a2f1260e4 If no script, default is null, not -1. Fixes #265
Includes test and exposing the command run for debugging.
2014-01-21 07:57:27 +00:00

44 lines
1.2 KiB
JavaScript

'use strict';
/*global describe:true, it: true, afterEach:true, beforeEach:true */
var assert = require('assert'),
utils = require('../utils'),
path = require('path'),
match = utils.match,
cleanup = utils.cleanup,
run = utils.run;
describe('nodemon full config test', function () {
var pwd = process.cwd();
afterEach(function () {
process.chdir(pwd);
});
beforeEach(function () {
// move to the fixtures directory to allow for config loading
process.chdir(path.resolve(pwd, 'test/fixtures'));
});
it('should allow execMap.js to be overridden', function (done) {
var p = run({ exec: '../../bin/nodemon.js',
args: ['-V']
}, {
error: function (data) {
p.send('quit');
cleanup(p, done, new Error(data));
}
});
p.on('message', function (event) {
if (event.type === 'log') {
if (match(event.data.message, 'starting `')) {
event.data.message.replace(/`(.*)`/, function (all, m) {
assert(m === 'node --harmony app.js', 'Arguments in the correct order: ' + m);
p.send('quit');
cleanup(p, done);
});
}
}
});
});
});