@@ -22,14 +22,14 @@ const fs_rmdir = promisify(fs.rmdir);
22
22
const fs_unlink = promisify ( fs . unlink ) ;
23
23
24
24
const isTravisMac = process . env . TRAVIS && os === 'darwin' ;
25
- const FIXTURES_PATH = sysPath . join ( __dirname , 'test-fixtures' ) ;
26
25
const FIXTURES_PATH_REL = 'test-fixtures' ;
26
+ const FIXTURES_PATH = sysPath . join ( __dirname , FIXTURES_PATH_REL ) ;
27
27
const allWatchers = [ ] ;
28
28
const PERM_ARR = 0o755 ; // rwe, r+e, r+e
29
29
let subdirId = 0 ;
30
30
let options ;
31
31
let currentDir ;
32
- let osXFsWatch ;
32
+ let macosFswatch ;
33
33
let win32Polling ;
34
34
let slowerDelay ;
35
35
@@ -86,9 +86,9 @@ const runTests = function(baseopts) {
86
86
87
87
before ( ( ) => {
88
88
// flags for bypassing special-case test failures on CI
89
- osXFsWatch = os === 'darwin' && ! baseopts . usePolling && ! baseopts . useFsEvents ;
89
+ macosFswatch = os === 'darwin' && ! baseopts . usePolling && ! baseopts . useFsEvents ;
90
90
win32Polling = os === 'win32' && baseopts . usePolling ;
91
- slowerDelay = osXFsWatch ? 100 : undefined ;
91
+ slowerDelay = macosFswatch ? 100 : undefined ;
92
92
} ) ;
93
93
94
94
beforeEach ( function clean ( ) {
@@ -393,7 +393,7 @@ const runTests = function(baseopts) {
393
393
addSpy . should . have . been . calledWith ( newPath ) ;
394
394
expect ( addSpy . args [ 0 ] [ 1 ] ) . to . be . ok ; // stats
395
395
rawSpy . should . have . been . called ;
396
- if ( ! osXFsWatch ) unlinkSpy . should . have . been . calledOnce ;
396
+ if ( ! macosFswatch ) unlinkSpy . should . have . been . calledOnce ;
397
397
} ) ;
398
398
it ( 'should emit `add`, not `change`, when previously deleted file is re-added' , async ( ) => {
399
399
const unlinkSpy = sinon . spy ( function unlink ( ) { } ) ;
@@ -797,7 +797,7 @@ const runTests = function(baseopts) {
797
797
spy . should . have . been . calledWith ( 'change' , changePath ) ;
798
798
spy . should . not . have . been . calledWith ( 'add' , unlinkPath ) ;
799
799
spy . should . not . have . been . calledWith ( 'addDir' ) ;
800
- if ( ! osXFsWatch ) spy . should . have . been . calledThrice ;
800
+ if ( ! macosFswatch ) spy . should . have . been . calledThrice ;
801
801
} ) ;
802
802
it ( 'should correctly handle conflicting glob patterns' , async ( ) => {
803
803
const changePath = getFixturePath ( 'change.txt' ) ;
@@ -1306,7 +1306,7 @@ const runTests = function(baseopts) {
1306
1306
spy . should . have . been . calledWith ( 'add' , getFixturePath ( 'change.txt' ) ) ;
1307
1307
spy . should . have . been . calledWith ( 'add' , getFixturePath ( 'unlink.txt' ) ) ;
1308
1308
spy . should . not . have . been . calledWith ( 'change' ) ;
1309
- if ( ! osXFsWatch ) spy . callCount . should . equal ( 4 ) ;
1309
+ if ( ! macosFswatch ) spy . callCount . should . equal ( 4 ) ;
1310
1310
} ) ;
1311
1311
it ( 'should recurse to specified depth' , async ( ) => {
1312
1312
options . depth = 1 ;
@@ -1324,7 +1324,7 @@ const runTests = function(baseopts) {
1324
1324
spy . should . have . been . calledWith ( 'change' , addPath ) ;
1325
1325
spy . should . not . have . been . calledWith ( 'add' , ignoredPath ) ;
1326
1326
spy . should . not . have . been . calledWith ( 'change' , ignoredPath ) ;
1327
- if ( ! osXFsWatch ) spy . callCount . should . equal ( 8 ) ;
1327
+ if ( ! macosFswatch ) spy . callCount . should . equal ( 8 ) ;
1328
1328
} ) ;
1329
1329
it ( 'should respect depth setting when following symlinks' , async ( ) => {
1330
1330
if ( os === 'win32' ) return true ; // skip on windows
@@ -1813,7 +1813,7 @@ const runTests = function(baseopts) {
1813
1813
await delay ( 300 ) ;
1814
1814
spy . should . have . been . calledWith ( 'change' , getFixturePath ( 'change.txt' ) ) ;
1815
1815
spy . should . not . have . been . calledWith ( 'add' ) ;
1816
- if ( ! osXFsWatch ) spy . should . have . been . calledOnce ;
1816
+ if ( ! macosFswatch ) spy . should . have . been . calledOnce ;
1817
1817
} ) ;
1818
1818
it ( 'should ignore unwatched paths that are a subset of watched paths' , async ( ) => {
1819
1819
let watcher = chokidar_watch ( currentDir , options ) ;
@@ -1834,7 +1834,7 @@ const runTests = function(baseopts) {
1834
1834
spy . should . have . been . calledWith ( 'change' , getFixturePath ( 'change.txt' ) ) ;
1835
1835
spy . should . not . have . been . calledWith ( 'add' , getFixturePath ( 'subdir/add.txt' ) ) ;
1836
1836
spy . should . not . have . been . calledWith ( 'unlink' ) ;
1837
- if ( ! osXFsWatch ) spy . should . have . been . calledOnce ;
1837
+ if ( ! macosFswatch ) spy . should . have . been . calledOnce ;
1838
1838
} ) ;
1839
1839
it ( 'should unwatch relative paths' , async ( ) => {
1840
1840
const fixturesDir = sysPath . relative ( process . cwd ( ) , currentDir ) ;
@@ -1853,7 +1853,7 @@ const runTests = function(baseopts) {
1853
1853
await delay ( 300 ) ;
1854
1854
spy . should . have . been . calledWith ( 'change' , changeFile ) ;
1855
1855
spy . should . not . have . been . calledWith ( 'add' ) ;
1856
- if ( ! osXFsWatch ) spy . should . have . been . calledOnce ;
1856
+ if ( ! macosFswatch ) spy . should . have . been . calledOnce ;
1857
1857
} ) ;
1858
1858
it ( 'should watch paths that were unwatched and added again' , async ( ) => {
1859
1859
const spy = sinon . spy ( ) ;
@@ -1871,7 +1871,7 @@ const runTests = function(baseopts) {
1871
1871
await write ( getFixturePath ( 'change.txt' ) , Date . now ( ) ) ;
1872
1872
await waitFor ( [ spy ] ) ;
1873
1873
spy . should . have . been . calledWith ( 'change' , getFixturePath ( 'change.txt' ) ) ;
1874
- if ( ! osXFsWatch ) spy . should . have . been . calledOnce ;
1874
+ if ( ! macosFswatch ) spy . should . have . been . calledOnce ;
1875
1875
} ) ;
1876
1876
it ( 'should unwatch paths that are relative to options.cwd' , async ( ) => {
1877
1877
options . cwd = currentDir ;
@@ -1889,7 +1889,7 @@ const runTests = function(baseopts) {
1889
1889
spy . should . have . been . calledWith ( 'change' , 'change.txt' ) ;
1890
1890
spy . should . not . have . been . calledWith ( 'add' ) ;
1891
1891
spy . should . not . have . been . calledWith ( 'unlink' ) ;
1892
- if ( ! osXFsWatch ) spy . should . have . been . calledOnce ;
1892
+ if ( ! macosFswatch ) spy . should . have . been . calledOnce ;
1893
1893
} ) ;
1894
1894
} ) ;
1895
1895
describe ( 'close' , ( ) => {
0 commit comments