tschaub / mock-fs

Configurable mock for the fs module
https://npmjs.org/package/mock-fs
Other
911 stars 86 forks source link

Replace os.tmpDir with temp-dir to get real paths for temp directories #318

Open reniowood opened 3 years ago

reniowood commented 3 years ago

Why

Since os.tmpDir doesn't return the actual path to the temp directory (i.e. MacOS), it is unable to use this library together with a library needs to access the actual path of the temp directory.

How

This pull request replaces os.tmpdir() with temp-dir library to achieve the object because the library returns the real path of the temp directory (i.e. /private/var instead of /var on MacOS).