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
Versions (please complete the following information):
Chokidar version: 3.6.0 and v4 beta (v4 branch)
Node version: v20.15.0
OS version: Windows 10 (built 19045)
To Reproduce:
On a Windows system, run .\node_modules\.bin\mocha -g "previously deleted" (for v3) or node --test --test-name-pattern "previously deleted" (for v4) to run a test which expects change events to not be fired. You may need to run it quite a few times.
Here's a test case for the v4 node --test setup:
it('should not emit `change` events for added files',async()=>{constaddSpy=sinon.spy(functionadd(){});constchangeSpy=sinon.spy(functionchange(){});consttestPath=getFixturePath('add.txt');watcher.on(EV.ADD,addSpy).on(EV.CHANGE,changeSpy);awaitwrite(testPath,'hello');awaitwaitFor([[addSpy.withArgs(testPath),1]]);changeSpy.should.not.have.been.called;});
Expected behavior
The change event should not be fired. Chokidar already deduplicates successive change events that happen within 5ms of each other, but does not deduplicate change requests that happen within 5ms of an add event.
Additional context
This seems to be causing the test failure in #1329. I can only guess that it's not failing in the current branches because of some complex timing conditions or just because it got very lucky.
The text was updated successfully, but these errors were encountered:
Ah, looks like this is already implemented as awaitWriteFinish. Maybe it's worth defaulting it to true in the next major release and adjusting the timing?
Versions (please complete the following information):
v4
branch)To Reproduce:
On a Windows system, run
.\node_modules\.bin\mocha -g "previously deleted"
(for v3) ornode --test --test-name-pattern "previously deleted"
(for v4) to run a test which expectschange
events to not be fired. You may need to run it quite a few times.Here's a test case for the v4
node --test
setup:Expected behavior
The
change
event should not be fired. Chokidar already deduplicates successive change events that happen within 5ms of each other, but does not deduplicate change requests that happen within 5ms of an add event.Additional context
This seems to be causing the test failure in #1329. I can only guess that it's not failing in the current branches because of some complex timing conditions or just because it got very lucky.
The text was updated successfully, but these errors were encountered: