mirror of
https://github.com/SrIzan10/nodemon.git
synced 2026-05-01 10:55:09 +00:00
25 lines
803 B
JavaScript
25 lines
803 B
JavaScript
'use strict';
|
|
/*global describe:true, it: true, after: true */
|
|
var nodemon = require('../../lib/'),
|
|
path = require('path'),
|
|
assert = require('assert');
|
|
|
|
describe('when nodemon runs (1)', function () {
|
|
var tmp = path.resolve('test/fixtures/env.js');
|
|
after(function (done) {
|
|
// clean up just in case.
|
|
nodemon.once('exit', function () {
|
|
nodemon.reset(done);
|
|
}).emit('quit');
|
|
});
|
|
|
|
it('should pass through environment values', function (done) {
|
|
nodemon({ script: tmp, stdout: false, env: { USER: 'nodemon' } }).on('stdout', function (data) {
|
|
assert(data.toString().trim() === 'nodemon', 'USER env value correctly set to "nodemon": ' + data.toString());
|
|
nodemon.once('exit', function () {
|
|
nodemon.reset(done);
|
|
}).emit('quit');
|
|
});
|
|
});
|
|
});
|