Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Dec 20, 2022
1 parent 15a0a21 commit ca2ae28
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions src/vs/platform/files/test/node/parcelWatcher.integrationTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,26 +245,20 @@ import { ltrim } from 'vs/base/common/strings';
await Promises.writeFile(anotherNewFilePath, 'Hello Another World');
await changeFuture;

// Skip following asserts on macOS where the fs-events service
// does not really give a full guarantee about the correlation
// of an event to a change.
if (!isMacintosh) {

// Read file does not emit event
changeFuture = awaitEvent(watcher, anotherNewFilePath, FileChangeType.UPDATED, 'unexpected-event-from-read-file');
await Promises.readFile(anotherNewFilePath);
await Promise.race([timeout(100), changeFuture]);

// Stat file does not emit event
changeFuture = awaitEvent(watcher, anotherNewFilePath, FileChangeType.UPDATED, 'unexpected-event-from-stat');
await Promises.stat(anotherNewFilePath);
await Promise.race([timeout(100), changeFuture]);

// Stat folder does not emit event
changeFuture = awaitEvent(watcher, copiedFolderpath, FileChangeType.UPDATED, 'unexpected-event-from-stat');
await Promises.stat(copiedFolderpath);
await Promise.race([timeout(100), changeFuture]);
}
// Read file does not emit event
changeFuture = awaitEvent(watcher, anotherNewFilePath, FileChangeType.UPDATED, 'unexpected-event-from-read-file');
await Promises.readFile(anotherNewFilePath);
await Promise.race([timeout(100), changeFuture]);

// Stat file does not emit event
changeFuture = awaitEvent(watcher, anotherNewFilePath, FileChangeType.UPDATED, 'unexpected-event-from-stat');
await Promises.stat(anotherNewFilePath);
await Promise.race([timeout(100), changeFuture]);

// Stat folder does not emit event
changeFuture = awaitEvent(watcher, copiedFolderpath, FileChangeType.UPDATED, 'unexpected-event-from-stat');
await Promises.stat(copiedFolderpath);
await Promise.race([timeout(100), changeFuture]);

// Delete file
changeFuture = awaitEvent(watcher, copiedFilepath, FileChangeType.DELETED);
Expand Down

0 comments on commit ca2ae28

Please sign in to comment.