mirror of
https://github.com/SrIzan10/nodemon.git
synced 2026-05-01 10:55:09 +00:00
33 lines
854 B
JavaScript
33 lines
854 B
JavaScript
/*global describe:true, it: true */
|
|
var nodemon = null,
|
|
assert = require('assert'),
|
|
path = require('path'),
|
|
touch = require('touch'),
|
|
appjs = path.resolve(__dirname, '..', 'fixtures', 'app.js');
|
|
|
|
describe('require-able', function () {
|
|
beforeEach(function () {
|
|
nodemon = require('../../lib/');
|
|
});
|
|
|
|
// it('should know nodemon has been required', function () {
|
|
// assert(nodemon.config.required, 'nodemon has required property');
|
|
// });
|
|
return;
|
|
it('should restart on file change', function (done) {
|
|
var restarted = false;
|
|
|
|
nodemon(appjs).on('start', function () {
|
|
setTimeout(function () {
|
|
touch.sync(appjs);
|
|
}, 1000);
|
|
}).on('restart', function () {
|
|
restarted = true;
|
|
nodemon.emit('quit');
|
|
}).on('quit', function () {
|
|
assert(restarted);
|
|
done();
|
|
});
|
|
});
|
|
});
|