You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/recipes/watch-mode.md
+2-5Lines changed: 2 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -59,11 +59,7 @@ Please note that the TAP reporter is unavailable when using watch mode.
59
59
60
60
## Requirements
61
61
62
-
AVA uses [`chokidar`] as the file watcher. It's configured as an optional dependency since `chokidar` sometimes can't be installed. Watch mode is not available if `chokidar` fails to install, instead you'll see a message like:
63
-
64
-
> The optional dependency chokidar failed to install and is required for --watch. Chokidar is likely not supported on your platform.
65
-
66
-
Please refer to the [`chokidar` documentation][`chokidar`] for how to resolve this problem.
62
+
AVA uses [`chokidar`] as the file watcher. Note that even if you see warnings about optional dependencies failing during install, it will still work fine. Please refer to the *[Install Troubleshooting]* section of `chokidar` documentation for how to resolve the installation problems with chokidar.
67
63
68
64
## Source files and test files
69
65
@@ -111,6 +107,7 @@ $ npm test -- --watch --verbose
111
107
Watch mode is relatively new and there might be some rough edges. Please [report](https://github.com/avajs/ava/issues) any issues you encounter. Thanks!
Copy file name to clipboardExpand all lines: lib/watcher.js
+2-10Lines changed: 2 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -2,20 +2,12 @@
2
2
varnodePath=require('path');
3
3
vardebug=require('debug')('ava:watcher');
4
4
vardiff=require('lodash.difference');
5
+
varchokidar=require('chokidar');
5
6
varflatten=require('arr-flatten');
6
7
varunion=require('array-union');
7
8
varuniq=require('array-uniq');
8
-
varAvaError=require('./ava-error');
9
9
varAvaFiles=require('./ava-files');
10
10
11
-
functionrequireChokidar(){
12
-
try{
13
-
returnrequire('chokidar');
14
-
}catch(err){
15
-
thrownewAvaError('The optional dependency chokidar failed to install and is required for --watch. Chokidar is likely not supported on your platform.');
16
-
}
17
-
}
18
-
19
11
functionrethrowAsync(err){
20
12
// Don't swallow exceptions. Note that any expected error should already have
21
13
// been logged.
@@ -96,7 +88,7 @@ Watcher.prototype.watchFiles = function () {
t.is(err.message,'The optional dependency chokidar failed to install and is required for --watch. Chokidar is likely not supported on your platform.');
54
-
}
55
-
});
56
-
57
-
group('chokidar is installed',function(beforeEach,test,group){
0 commit comments