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
Copy file name to clipboardExpand all lines: docs/contributor/writing-tests-for-vscode-swift.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,9 +121,9 @@ Mocking file system access can be a challenging endeavor that is prone to fail w
121
121
The [`mock-fs`](https://github.com/tschaub/mock-fs) module is a well-maintained library that can be used to mitigate these issues by temporarily replacing Node's built-in `fs` module with an in-memory file system. This can be useful for testing logic that uses the `fs` module without actually reaching out to the file system. Just a single function call can be used to configure what the fake file system will contain:
122
122
123
123
```typescript
124
-
import*aschaifrom"chai";
124
+
import{ expect }from"chai";
125
125
import*asmockFSfrom"mock-fs";
126
-
import*asfsfrom"fs/promises";
126
+
import*asvscodefrom"vscode";
127
127
128
128
suite("mock-fs example", () => {
129
129
// This teardown step is also important to make sure your tests clean up the
0 commit comments