mirror of
https://github.com/SrIzan10/nodemon.git
synced 2026-05-01 10:55:09 +00:00
* chore: bump chokidar to latest * test: fix weird output on restart filename * test: skip old broken test * fix: node_modules watched off relative path Fixes #1294 Fixes #1305 (though couldn't confirm - just looks very similar) I've gone back and forth on this Chokidar option `cwd` and in this fix I've removed it from the config. I've checked the issues that were raised that caused me to add the option, and they still appear to pass in the tests, so I believe it's okay. However, it _might_ come back in - just a note for Future @remy.
57 lines
1.7 KiB
JavaScript
57 lines
1.7 KiB
JavaScript
'use strict';
|
|
/*global describe:true, it: true, after: true */
|
|
var nodemon = require('../../lib/');
|
|
var utils = require('../utils');
|
|
var path = require('path');
|
|
var appjs = path.resolve(__dirname, '..', 'fixtures', 'watch-count', 'index.js');
|
|
var assert = require('assert');
|
|
var watchRe = /watching ([\d,]+) files/;
|
|
|
|
describe('watch count', function () {
|
|
var pwd = process.cwd();
|
|
|
|
afterEach(function () {
|
|
// reset the cwd
|
|
process.chdir(pwd);
|
|
});
|
|
|
|
after(function (done) {
|
|
// clean up just in case.
|
|
nodemon.once('exit', function () {
|
|
nodemon.reset(done);
|
|
}).emit('quit');
|
|
});
|
|
|
|
it('should respect ignore rules', function (done) {
|
|
process.chdir('test/fixtures/watch-count');
|
|
nodemon({ script: appjs, verbose: true }).on('start', function () {
|
|
setTimeout(function () {
|
|
nodemon.once('exit', done).emit('quit');
|
|
}, 200);
|
|
}).on('log', function (data) {
|
|
var match = null;
|
|
var count = 0;
|
|
if (match = data.message.match(watchRe)) {
|
|
count = match[1].replace(',', '') * 1;
|
|
assert(count === 6, 'Watching ' + count + ' files, expecting 6.');
|
|
}
|
|
});
|
|
});
|
|
|
|
it('should ignore node_modules from any dir', function (done) {
|
|
process.chdir('test/fixtures/watch-count/lib');
|
|
nodemon({ script: appjs, verbose: true, watch: '..' }).on('start', function () {
|
|
setTimeout(function () {
|
|
nodemon.once('exit', done).emit('quit');
|
|
}, 200);
|
|
}).on('log', function (data) {
|
|
var match = null;
|
|
var count = 0;
|
|
if (match = data.message.match(watchRe)) {
|
|
count = match[1].replace(',', '') * 1;
|
|
assert(count === 6, 'Watching ' + count + ' files, expecting 6.');
|
|
}
|
|
});
|
|
});
|
|
});
|