# fs: Refactor the code around \`GlobalWatcher\` to be more testable \(\#63894\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/db10a8dd733e64682638b98232c190e8babecd5a)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: db10a8dd733e64682638b98232c190e8babecd5a

Requested commit: db10a8dd733e64682638b98232c190e8babecd5a

Commit: db10a8dd733e64682638b98232c190e8babecd5a

Tree: 7ccd76f76cf9379fb3d76e043d3a3c3b0e49461d

Author: Cole Miller

Committer: GitHub

## Message

```
fs: Refactor the code around `GlobalWatcher` to be more testable (#63894)

This is a pure refactoring PR to make our FS watching code more
testable. It does two things:

1. Make the `GlobalWatcher` be owned by `RealFs` or `FakeFs` instead of
being a process-wide global.
2. Delete `FakeWatcher` and its `Watcher` implementation, and instead
mock the notify crate itself in `FakeFs` tests via the existing
`WatchBackend` trait. Now all our FS watching code down to the notify
boundary runs the same in tests and production.

Release Notes:
- N/A
```

## Parents

- [ad51f6825c362d930c78a6579eecd21a06a7055d](https://git.cafe/gitcafe/zed/commit/ad51f6825c362d930c78a6579eecd21a06a7055d?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/db10a8dd733e64682638b98232c190e8babecd5a?format=markdown)
