Skip to content

Commit 793639f

Browse files
committed
Rename osxfswatch.
1 parent 078bc2d commit 793639f

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

test.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ const fs_rmdir = promisify(fs.rmdir);
2222
const fs_unlink = promisify(fs.unlink);
2323

2424
const isTravisMac = process.env.TRAVIS && os === 'darwin';
25-
const FIXTURES_PATH = sysPath.join(__dirname, 'test-fixtures');
2625
const FIXTURES_PATH_REL = 'test-fixtures';
26+
const FIXTURES_PATH = sysPath.join(__dirname, FIXTURES_PATH_REL);
2727
const allWatchers = [];
2828
const PERM_ARR = 0o755; // rwe, r+e, r+e
2929
let subdirId = 0;
3030
let options;
3131
let currentDir;
32-
let osXFsWatch;
32+
let macosFswatch;
3333
let win32Polling;
3434
let slowerDelay;
3535

@@ -86,9 +86,9 @@ const runTests = function(baseopts) {
8686

8787
before(() => {
8888
// 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;
9090
win32Polling = os === 'win32' && baseopts.usePolling;
91-
slowerDelay = osXFsWatch ? 100 : undefined;
91+
slowerDelay = macosFswatch ? 100 : undefined;
9292
});
9393

9494
beforeEach(function clean() {
@@ -393,7 +393,7 @@ const runTests = function(baseopts) {
393393
addSpy.should.have.been.calledWith(newPath);
394394
expect(addSpy.args[0][1]).to.be.ok; // stats
395395
rawSpy.should.have.been.called;
396-
if (!osXFsWatch) unlinkSpy.should.have.been.calledOnce;
396+
if (!macosFswatch) unlinkSpy.should.have.been.calledOnce;
397397
});
398398
it('should emit `add`, not `change`, when previously deleted file is re-added', async () => {
399399
const unlinkSpy = sinon.spy(function unlink(){});
@@ -797,7 +797,7 @@ const runTests = function(baseopts) {
797797
spy.should.have.been.calledWith('change', changePath);
798798
spy.should.not.have.been.calledWith('add', unlinkPath);
799799
spy.should.not.have.been.calledWith('addDir');
800-
if (!osXFsWatch) spy.should.have.been.calledThrice;
800+
if (!macosFswatch) spy.should.have.been.calledThrice;
801801
});
802802
it('should correctly handle conflicting glob patterns', async () => {
803803
const changePath = getFixturePath('change.txt');
@@ -1306,7 +1306,7 @@ const runTests = function(baseopts) {
13061306
spy.should.have.been.calledWith('add', getFixturePath('change.txt'));
13071307
spy.should.have.been.calledWith('add', getFixturePath('unlink.txt'));
13081308
spy.should.not.have.been.calledWith('change');
1309-
if (!osXFsWatch) spy.callCount.should.equal(4);
1309+
if (!macosFswatch) spy.callCount.should.equal(4);
13101310
});
13111311
it('should recurse to specified depth', async () => {
13121312
options.depth = 1;
@@ -1324,7 +1324,7 @@ const runTests = function(baseopts) {
13241324
spy.should.have.been.calledWith('change', addPath);
13251325
spy.should.not.have.been.calledWith('add', ignoredPath);
13261326
spy.should.not.have.been.calledWith('change', ignoredPath);
1327-
if (!osXFsWatch) spy.callCount.should.equal(8);
1327+
if (!macosFswatch) spy.callCount.should.equal(8);
13281328
});
13291329
it('should respect depth setting when following symlinks', async () => {
13301330
if (os === 'win32') return true; // skip on windows
@@ -1813,7 +1813,7 @@ const runTests = function(baseopts) {
18131813
await delay(300);
18141814
spy.should.have.been.calledWith('change', getFixturePath('change.txt'));
18151815
spy.should.not.have.been.calledWith('add');
1816-
if (!osXFsWatch) spy.should.have.been.calledOnce;
1816+
if (!macosFswatch) spy.should.have.been.calledOnce;
18171817
});
18181818
it('should ignore unwatched paths that are a subset of watched paths', async () => {
18191819
let watcher = chokidar_watch(currentDir, options);
@@ -1834,7 +1834,7 @@ const runTests = function(baseopts) {
18341834
spy.should.have.been.calledWith('change', getFixturePath('change.txt'));
18351835
spy.should.not.have.been.calledWith('add', getFixturePath('subdir/add.txt'));
18361836
spy.should.not.have.been.calledWith('unlink');
1837-
if (!osXFsWatch) spy.should.have.been.calledOnce;
1837+
if (!macosFswatch) spy.should.have.been.calledOnce;
18381838
});
18391839
it('should unwatch relative paths', async () => {
18401840
const fixturesDir = sysPath.relative(process.cwd(), currentDir);
@@ -1853,7 +1853,7 @@ const runTests = function(baseopts) {
18531853
await delay(300);
18541854
spy.should.have.been.calledWith('change', changeFile);
18551855
spy.should.not.have.been.calledWith('add');
1856-
if (!osXFsWatch) spy.should.have.been.calledOnce;
1856+
if (!macosFswatch) spy.should.have.been.calledOnce;
18571857
});
18581858
it('should watch paths that were unwatched and added again', async () => {
18591859
const spy = sinon.spy();
@@ -1871,7 +1871,7 @@ const runTests = function(baseopts) {
18711871
await write(getFixturePath('change.txt'), Date.now());
18721872
await waitFor([spy]);
18731873
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;
18751875
});
18761876
it('should unwatch paths that are relative to options.cwd', async () => {
18771877
options.cwd = currentDir;
@@ -1889,7 +1889,7 @@ const runTests = function(baseopts) {
18891889
spy.should.have.been.calledWith('change', 'change.txt');
18901890
spy.should.not.have.been.calledWith('add');
18911891
spy.should.not.have.been.calledWith('unlink');
1892-
if (!osXFsWatch) spy.should.have.been.calledOnce;
1892+
if (!macosFswatch) spy.should.have.been.calledOnce;
18931893
});
18941894
});
18951895
describe('close', () => {

0 commit comments

Comments
 (0)