zowe / zowe-explorer-vscode

Visual Studio Code Extension for Zowe, which lets users interact with z/OS Data Sets, Unix System Services, and Jobs on a remote mainframe instance. Powered by Zowe SDKs.
Eclipse Public License 2.0
170 stars 92 forks source link

Use `memfs` to test filesystem operations in unit tests #2213

Open t1m0thyj opened 1 year ago

t1m0thyj commented 1 year ago

Recently we had an issue (fixed in #2188) where we were writing new contents to a JSON file that were shorter than the old contents without truncating the file, which resulted in invalid JSON.

With our current unit tests that mock fs methods using Jest, we don't have a way to detect this kind of bug. If we added tests that use the memfs package to mock out the file system in memory, we could.

Places where these kinds of tests could be useful:

Resources

github-actions[bot] commented 1 year ago

Thank you for raising this issue. The community has 90 days to upvote 👍 the issue. If it receives 10 upvotes, we will move it to our backlog. If not, we will close it.