From b446782ef1c6458e8bef4538a919809b82486627 Mon Sep 17 00:00:00 2001 From: Anshuman Verma Date: Sat, 29 May 2021 18:23:29 +0530 Subject: [PATCH 1/4] fix: polling usage in watchFiles --- lib/Server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Server.js b/lib/Server.js index b1c6d5c41f..7ffd19f61c 100644 --- a/lib/Server.js +++ b/lib/Server.js @@ -973,7 +973,7 @@ class Server { // https://github.com/webpack/watchpack/blob/master/lib/DirectoryWatcher.js#L49 // this isn't an elegant solution, but we'll improve it in the future // eslint-disable-next-line no-undefined - const usePolling = watchOptions.poll ? true : undefined; + const usePolling = !!watchOptions.poll || watchOptions.usePolling; const interval = typeof watchOptions.poll === 'number' ? watchOptions.poll From a83228bbc2e5827530a21555a3a20ba754d0e70f Mon Sep 17 00:00:00 2001 From: Anshuman Verma Date: Sat, 29 May 2021 19:04:39 +0530 Subject: [PATCH 2/4] fix: polling usage in watchFiles --- lib/Server.js | 7 +++++-- test/server/watchFiles-option.test.js | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/Server.js b/lib/Server.js index 7ffd19f61c..88e3f5500c 100644 --- a/lib/Server.js +++ b/lib/Server.js @@ -973,9 +973,12 @@ class Server { // https://github.com/webpack/watchpack/blob/master/lib/DirectoryWatcher.js#L49 // this isn't an elegant solution, but we'll improve it in the future // eslint-disable-next-line no-undefined - const usePolling = !!watchOptions.poll || watchOptions.usePolling; + const usePolling = watchOptions.usePolling || Boolean(watchOptions.poll); const interval = - typeof watchOptions.poll === 'number' + // eslint-disable-next-line no-nested-ternary + typeof watchOptions.interval !== 'undefined' + ? watchOptions.interval + : typeof watchOptions.poll === 'number' ? watchOptions.poll : // eslint-disable-next-line no-undefined undefined; diff --git a/test/server/watchFiles-option.test.js b/test/server/watchFiles-option.test.js index b14a79cdd4..3b1c1a22c0 100644 --- a/test/server/watchFiles-option.test.js +++ b/test/server/watchFiles-option.test.js @@ -2,6 +2,7 @@ const path = require('path'); const fs = require('graceful-fs'); +const chokidar = require('chokidar'); const testServer = require('../helpers/test-server'); const config = require('../fixtures/contentbase-config/webpack.config'); const port = require('../ports-map')['watchFiles-option']; @@ -277,6 +278,8 @@ describe("'watchFiles' option", () => { describe('should work with options', () => { const file = path.join(watchDir, 'assets/example.txt'); + const chokidarMock = jest.spyOn(chokidar, 'watch'); + beforeAll((done) => { server = testServer.start( config, @@ -285,6 +288,7 @@ describe("'watchFiles' option", () => { paths: file, options: { usePolling: true, + interval: 400, }, }, port, @@ -298,6 +302,21 @@ describe("'watchFiles' option", () => { fs.truncateSync(file); }); + it('should pass correct options to chokidar config', () => { + expect(chokidarMock).toHaveBeenCalledWith(file, { + ignoreInitial: true, + persistent: true, + followSymlinks: false, + atomic: false, + alwaysStat: true, + ignorePermissionErrors: true, + // eslint-disable-next-line no-undefined + ignored: undefined, + usePolling: true, + interval: 400, + }); + }); + it('should reload on file content changed', (done) => { server.staticWatchers[0].on('change', (changedPath) => { expect(changedPath).toBe(file); From ac61c7c5dac3b08fde569544147874c9c2dd0e41 Mon Sep 17 00:00:00 2001 From: Anshuman Verma Date: Mon, 31 May 2021 13:32:23 +0530 Subject: [PATCH 3/4] fix: polling tests --- lib/Server.js | 5 +- .../watchFiles-option.test.js.snap.webpack4 | 103 +++++++++++++++++ .../watchFiles-option.test.js.snap.webpack5 | 103 +++++++++++++++++ test/server/watchFiles-option.test.js | 107 ++++++++++-------- 4 files changed, 271 insertions(+), 47 deletions(-) create mode 100644 test/server/__snapshots__/watchFiles-option.test.js.snap.webpack4 create mode 100644 test/server/__snapshots__/watchFiles-option.test.js.snap.webpack5 diff --git a/lib/Server.js b/lib/Server.js index 88e3f5500c..9ae798d97e 100644 --- a/lib/Server.js +++ b/lib/Server.js @@ -973,7 +973,10 @@ class Server { // https://github.com/webpack/watchpack/blob/master/lib/DirectoryWatcher.js#L49 // this isn't an elegant solution, but we'll improve it in the future // eslint-disable-next-line no-undefined - const usePolling = watchOptions.usePolling || Boolean(watchOptions.poll); + const usePolling = + typeof watchOptions.usePolling !== 'undefined' + ? watchOptions.usePolling + : Boolean(watchOptions.poll); const interval = // eslint-disable-next-line no-nested-ternary typeof watchOptions.interval !== 'undefined' diff --git a/test/server/__snapshots__/watchFiles-option.test.js.snap.webpack4 b/test/server/__snapshots__/watchFiles-option.test.js.snap.webpack4 new file mode 100644 index 0000000000..8a3907a47a --- /dev/null +++ b/test/server/__snapshots__/watchFiles-option.test.js.snap.webpack4 @@ -0,0 +1,103 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`'watchFiles' option should work with options {"poll":200} should pass correct options to chokidar config 1`] = ` +Array [ + "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", + Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": 200, + "persistent": true, + "usePolling": true, + }, +] +`; + +exports[`'watchFiles' option should work with options {"poll":true} should pass correct options to chokidar config 1`] = ` +Array [ + "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", + Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": undefined, + "persistent": true, + "usePolling": true, + }, +] +`; + +exports[`'watchFiles' option should work with options {"usePolling":false,"poll":true} should pass correct options to chokidar config 1`] = ` +Array [ + "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", + Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": undefined, + "persistent": true, + "usePolling": false, + }, +] +`; + +exports[`'watchFiles' option should work with options {"usePolling":false} should pass correct options to chokidar config 1`] = ` +Array [ + "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", + Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": undefined, + "persistent": true, + "usePolling": false, + }, +] +`; + +exports[`'watchFiles' option should work with options {"usePolling":true,"interval":200,"poll":400} should pass correct options to chokidar config 1`] = ` +Array [ + "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", + Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": 200, + "persistent": true, + "usePolling": true, + }, +] +`; + +exports[`'watchFiles' option should work with options {"usePolling":true} should pass correct options to chokidar config 1`] = ` +Array [ + "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", + Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": undefined, + "persistent": true, + "usePolling": true, + }, +] +`; diff --git a/test/server/__snapshots__/watchFiles-option.test.js.snap.webpack5 b/test/server/__snapshots__/watchFiles-option.test.js.snap.webpack5 new file mode 100644 index 0000000000..8a3907a47a --- /dev/null +++ b/test/server/__snapshots__/watchFiles-option.test.js.snap.webpack5 @@ -0,0 +1,103 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`'watchFiles' option should work with options {"poll":200} should pass correct options to chokidar config 1`] = ` +Array [ + "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", + Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": 200, + "persistent": true, + "usePolling": true, + }, +] +`; + +exports[`'watchFiles' option should work with options {"poll":true} should pass correct options to chokidar config 1`] = ` +Array [ + "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", + Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": undefined, + "persistent": true, + "usePolling": true, + }, +] +`; + +exports[`'watchFiles' option should work with options {"usePolling":false,"poll":true} should pass correct options to chokidar config 1`] = ` +Array [ + "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", + Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": undefined, + "persistent": true, + "usePolling": false, + }, +] +`; + +exports[`'watchFiles' option should work with options {"usePolling":false} should pass correct options to chokidar config 1`] = ` +Array [ + "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", + Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": undefined, + "persistent": true, + "usePolling": false, + }, +] +`; + +exports[`'watchFiles' option should work with options {"usePolling":true,"interval":200,"poll":400} should pass correct options to chokidar config 1`] = ` +Array [ + "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", + Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": 200, + "persistent": true, + "usePolling": true, + }, +] +`; + +exports[`'watchFiles' option should work with options {"usePolling":true} should pass correct options to chokidar config 1`] = ` +Array [ + "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", + Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": undefined, + "persistent": true, + "usePolling": true, + }, +] +`; diff --git a/test/server/watchFiles-option.test.js b/test/server/watchFiles-option.test.js index 3b1c1a22c0..9812e10634 100644 --- a/test/server/watchFiles-option.test.js +++ b/test/server/watchFiles-option.test.js @@ -280,54 +280,69 @@ describe("'watchFiles' option", () => { const chokidarMock = jest.spyOn(chokidar, 'watch'); - beforeAll((done) => { - server = testServer.start( - config, - { - watchFiles: { - paths: file, - options: { - usePolling: true, - interval: 400, - }, - }, - port, - }, - done - ); - }); - - afterAll((done) => { - testServer.close(done); - fs.truncateSync(file); - }); - - it('should pass correct options to chokidar config', () => { - expect(chokidarMock).toHaveBeenCalledWith(file, { - ignoreInitial: true, - persistent: true, - followSymlinks: false, - atomic: false, - alwaysStat: true, - ignorePermissionErrors: true, - // eslint-disable-next-line no-undefined - ignored: undefined, + const optionCases = [ + { + poll: true, + }, + { + poll: 200, + }, + { usePolling: true, - interval: 400, - }); - }); - - it('should reload on file content changed', (done) => { - server.staticWatchers[0].on('change', (changedPath) => { - expect(changedPath).toBe(file); - - done(); + }, + { + usePolling: false, + }, + { + usePolling: false, + poll: true, + }, + { + usePolling: true, + interval: 200, + poll: 400, + }, + ]; + + optionCases.forEach((optionCase) => { + describe(JSON.stringify(optionCase), () => { + beforeAll((done) => { + chokidarMock.mockClear(); + server = testServer.start( + config, + { + watchFiles: { + paths: file, + options: optionCase, + }, + port, + }, + done + ); + }); + + afterAll((done) => { + testServer.close(done); + fs.truncateSync(file); + }); + + it('should pass correct options to chokidar config', () => { + expect(chokidarMock.mock.calls[0]).toMatchSnapshot(); + }); + + it('should reload on file content changed', (done) => { + server.staticWatchers[0].on('change', (changedPath) => { + expect(changedPath).toBe(file); + + done(); + }); + + // change file content + setTimeout(() => { + fs.writeFileSync(file, 'Kurosaki Ichigo', 'utf8'); + }, 1000); + }); }); - - // change file content - setTimeout(() => { - fs.writeFileSync(file, 'Kurosaki Ichigo', 'utf8'); - }, 1000); }); }); }); From 152ebb5dffd696c142c0d66ab32244fe7eaa076c Mon Sep 17 00:00:00 2001 From: Anshuman Verma Date: Mon, 31 May 2021 13:49:13 +0530 Subject: [PATCH 4/4] fix: polling tests --- .../watchFiles-option.test.js.snap.webpack4 | 150 ++++++++---------- .../watchFiles-option.test.js.snap.webpack5 | 150 ++++++++---------- test/server/watchFiles-option.test.js | 2 +- 3 files changed, 133 insertions(+), 169 deletions(-) diff --git a/test/server/__snapshots__/watchFiles-option.test.js.snap.webpack4 b/test/server/__snapshots__/watchFiles-option.test.js.snap.webpack4 index 8a3907a47a..783029c365 100644 --- a/test/server/__snapshots__/watchFiles-option.test.js.snap.webpack4 +++ b/test/server/__snapshots__/watchFiles-option.test.js.snap.webpack4 @@ -1,103 +1,85 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`'watchFiles' option should work with options {"poll":200} should pass correct options to chokidar config 1`] = ` -Array [ - "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", - Object { - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": 200, - "persistent": true, - "usePolling": true, - }, -] +Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": 200, + "persistent": true, + "usePolling": true, +} `; exports[`'watchFiles' option should work with options {"poll":true} should pass correct options to chokidar config 1`] = ` -Array [ - "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", - Object { - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": undefined, - "persistent": true, - "usePolling": true, - }, -] +Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": undefined, + "persistent": true, + "usePolling": true, +} `; exports[`'watchFiles' option should work with options {"usePolling":false,"poll":true} should pass correct options to chokidar config 1`] = ` -Array [ - "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", - Object { - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": undefined, - "persistent": true, - "usePolling": false, - }, -] +Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": undefined, + "persistent": true, + "usePolling": false, +} `; exports[`'watchFiles' option should work with options {"usePolling":false} should pass correct options to chokidar config 1`] = ` -Array [ - "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", - Object { - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": undefined, - "persistent": true, - "usePolling": false, - }, -] +Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": undefined, + "persistent": true, + "usePolling": false, +} `; exports[`'watchFiles' option should work with options {"usePolling":true,"interval":200,"poll":400} should pass correct options to chokidar config 1`] = ` -Array [ - "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", - Object { - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": 200, - "persistent": true, - "usePolling": true, - }, -] +Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": 200, + "persistent": true, + "usePolling": true, +} `; exports[`'watchFiles' option should work with options {"usePolling":true} should pass correct options to chokidar config 1`] = ` -Array [ - "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", - Object { - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": undefined, - "persistent": true, - "usePolling": true, - }, -] +Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": undefined, + "persistent": true, + "usePolling": true, +} `; diff --git a/test/server/__snapshots__/watchFiles-option.test.js.snap.webpack5 b/test/server/__snapshots__/watchFiles-option.test.js.snap.webpack5 index 8a3907a47a..783029c365 100644 --- a/test/server/__snapshots__/watchFiles-option.test.js.snap.webpack5 +++ b/test/server/__snapshots__/watchFiles-option.test.js.snap.webpack5 @@ -1,103 +1,85 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`'watchFiles' option should work with options {"poll":200} should pass correct options to chokidar config 1`] = ` -Array [ - "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", - Object { - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": 200, - "persistent": true, - "usePolling": true, - }, -] +Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": 200, + "persistent": true, + "usePolling": true, +} `; exports[`'watchFiles' option should work with options {"poll":true} should pass correct options to chokidar config 1`] = ` -Array [ - "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", - Object { - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": undefined, - "persistent": true, - "usePolling": true, - }, -] +Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": undefined, + "persistent": true, + "usePolling": true, +} `; exports[`'watchFiles' option should work with options {"usePolling":false,"poll":true} should pass correct options to chokidar config 1`] = ` -Array [ - "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", - Object { - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": undefined, - "persistent": true, - "usePolling": false, - }, -] +Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": undefined, + "persistent": true, + "usePolling": false, +} `; exports[`'watchFiles' option should work with options {"usePolling":false} should pass correct options to chokidar config 1`] = ` -Array [ - "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", - Object { - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": undefined, - "persistent": true, - "usePolling": false, - }, -] +Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": undefined, + "persistent": true, + "usePolling": false, +} `; exports[`'watchFiles' option should work with options {"usePolling":true,"interval":200,"poll":400} should pass correct options to chokidar config 1`] = ` -Array [ - "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", - Object { - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": 200, - "persistent": true, - "usePolling": true, - }, -] +Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": 200, + "persistent": true, + "usePolling": true, +} `; exports[`'watchFiles' option should work with options {"usePolling":true} should pass correct options to chokidar config 1`] = ` -Array [ - "/Users/anshumanv/Code/GitHub/webpack-dev-server/test/fixtures/contentbase-config/public/assets/example.txt", - Object { - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": undefined, - "persistent": true, - "usePolling": true, - }, -] +Object { + "alwaysStat": true, + "atomic": false, + "followSymlinks": false, + "ignoreInitial": true, + "ignorePermissionErrors": true, + "ignored": undefined, + "interval": undefined, + "persistent": true, + "usePolling": true, +} `; diff --git a/test/server/watchFiles-option.test.js b/test/server/watchFiles-option.test.js index 9812e10634..87ce8236de 100644 --- a/test/server/watchFiles-option.test.js +++ b/test/server/watchFiles-option.test.js @@ -327,7 +327,7 @@ describe("'watchFiles' option", () => { }); it('should pass correct options to chokidar config', () => { - expect(chokidarMock.mock.calls[0]).toMatchSnapshot(); + expect(chokidarMock.mock.calls[0][1]).toMatchSnapshot(); }); it('should reload on file content changed', (done) => {