mirror of
https://github.com/SrIzan10/nodemon.git
synced 2026-05-01 10:55:09 +00:00
test: ensure ignore relative paths
(when asked)
This commit is contained in:
@@ -58,6 +58,11 @@ function watch() {
|
||||
persistent: true,
|
||||
usePolling: config.options.legacyWatch || false,
|
||||
interval: config.options.pollingInterval,
|
||||
// note to future developer: I've gone back and forth on adding `cwd`
|
||||
// to the props and in some cases it fixes bugs but typically it causes
|
||||
// bugs elsewhere (since nodemon is used is so many ways). the final
|
||||
// decision is to *not* use it at all and work around it
|
||||
// cwd: ...
|
||||
};
|
||||
|
||||
if (utils.isWindows) {
|
||||
@@ -85,7 +90,7 @@ function watch() {
|
||||
|
||||
watchedFiles.push(file);
|
||||
bus.emit('watching', file);
|
||||
debug('watching dir: %s', file);
|
||||
debug('chokidar watching: %s', file);
|
||||
});
|
||||
watcher.on('ready', function () {
|
||||
watchedFiles = Array.from(new Set(watchedFiles)); // ensure no dupes
|
||||
|
||||
1786
package-lock.json
generated
1786
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@@ -49,19 +49,19 @@
|
||||
"husky": "^0.14.3",
|
||||
"istanbul": "^0.4.5",
|
||||
"jscs": "^3.0.7",
|
||||
"mocha": "^2.3.3",
|
||||
"mocha": "^2.5.3",
|
||||
"proxyquire": "^1.8.0",
|
||||
"semantic-release": "^8.2.0",
|
||||
"semantic-release": "^8.2.3",
|
||||
"should": "~4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"chokidar": "^2.1.5",
|
||||
"debug": "^3.1.0",
|
||||
"chokidar": "^2.1.8",
|
||||
"debug": "^3.2.6",
|
||||
"ignore-by-default": "^1.0.1",
|
||||
"minimatch": "^3.0.4",
|
||||
"pstree.remy": "^1.1.6",
|
||||
"semver": "^5.5.0",
|
||||
"supports-color": "^5.2.0",
|
||||
"pstree.remy": "^1.1.7",
|
||||
"semver": "^5.7.1",
|
||||
"supports-color": "^5.5.0",
|
||||
"touch": "^3.1.0",
|
||||
"undefsafe": "^2.0.2",
|
||||
"update-notifier": "^2.5.0"
|
||||
|
||||
@@ -571,4 +571,20 @@ describe('watcher', function() {
|
||||
assert(matched.result.length === 1, 'found match ' + matched.results);
|
||||
});
|
||||
|
||||
|
||||
it('should ignore relative directories', () => {
|
||||
const monitor = match.rulesToMonitor([], [
|
||||
"node_modules/*",
|
||||
"**/logs/*"
|
||||
])
|
||||
|
||||
var matched = match(
|
||||
['logs/a'],
|
||||
monitor,
|
||||
'js,mjs,json'
|
||||
);
|
||||
|
||||
assert(matched.ignored === 1 && matched.result.length === 0, JSON.stringify(matched));
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user