FileService Mocking #14767
-
I'm writing code that will abstract writing my new file types away from direct FileService calls using adapters written for each type. I want to test the adapters, however, FileService appears to not be easily mocked. Any recommendations? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It appears there is no good way except muddling through the code and waiting for my test mocks to break the next time Theia frontend or FileService changes. Theia seems to have many well-written pieces, but FileService isn't one. Seriously, does the FileService really have a dependency on "defaultForOSTheme" and preferences in general? |
Beta Was this translation helpful? Give feedback.
In the end, the complexity of the
FileService
stems from VS Code, as we use it to support thevscode.workspace.fs
API.Aside from that, I'm wondering whether it's possible to write browser/playwright tests to test your adapters, instead of going through the hassle of trying to mock everything.