Use native recursive option when available/appropriate#7
Use native recursive option when available/appropriate#7sindresorhus merged 1 commit intosindresorhus:masterfrom coreyfarrell:native-recursive
recursive option when available/appropriate#7Conversation
|
Apparently windows throws EPERM on Another thing I've noticed is that neither
|
It's not. You can force Nyc to ignore it using a directive comment. Example: https://github.com/sindresorhus/got/blob/c8e358ff3642fe169ae947efd29db8a418b12dc1/source/utils/timed-out.js#L18 |
We should handle it the same as whatever the native
Let's follow whatever |
|
Can you update the docs to say that it uses the native method when available in Node.js and link to the recursive option docs and when it's not using a custom |
|
I'm aware of the istanbul ignore directive but we do want that coverage when testing against older versions of node. So maybe just adding the I've opened nodejs/node#25110 to get clarification on the intended functionality of recursive mkdir. If this causes a fix to node.js then I'll probably update the semver check to ensure that only fixed versions of the native mkdir are used. I'll post updates including docs once I hear back on the node.js issue. |
|
After discussing with @bcoe I believe the current behavior of the native |
|
I'm booting up a Win10 VM so I can troubleshoot |
node 10.12.0 and above support an options object to fs.mkdir and fs.mkdirSync with a `recursive` option. Use this when available and options.fs does not provide replacement mkdir / mkdirSync.
|
Sorry for the noise, testing on Windows is difficult for me. I think I've got this so |
|
@sindresorhus when you have a chance could you give this a review? |
recursive option when available/appropriate
|
Looks good :) |
I've split into 3 commits to make it easier if you do not want all changes. First commit just fixes testing to work with
ava@1. Second comment enables use of native recursive fs.mkdir but causes really low coverage to be reported when tested against node.js >=10.12.0. The third commit modifies testing so the legacy methods are used even in current versions of node. I'm not sure it's a good idea to chase coverage like this, in node 10.12.0 we should probably test error handling of the native method does the same as the legacy method?Test coverage on
>=10.12.0without 3rd commit:With
fs option customtest added but error handling tests not modified:With complete third commit:
Closes #5