Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace mkdirp in tests with native JS #743

Merged
merged 2 commits into from Oct 11, 2021
Merged

Replace mkdirp in tests with native JS #743

merged 2 commits into from Oct 11, 2021

Conversation

thornjad
Copy link
Member

@thornjad thornjad commented Oct 6, 2021

mkdirp is one of those borderline useless packages. This PR replaces it with regular Node fs calls.

@thornjad thornjad added the patch version Small, non-breaking, bug fix or trivial change label Oct 6, 2021
const path = require('path');

const root = `${__dirname}/public`;
const baseDir = 'base';

mkdirp.sync(`${root}/emptyDir`);
require('fs').mkdirSync(`${root}/emptyDir`, {recursive: true});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency you could have done something like

const { mkdirSync } = require('fs');
...
mkdirSync(`${root}/emptyDir`, {recursive: true});

Not a big deal, just a bit less noisy and the code would have looked similar to before.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about it, but settled on just containing it to one line

@thornjad thornjad merged commit 8647245 into master Oct 11, 2021
@thornjad thornjad deleted the remove-mkdirp branch October 11, 2021 15:52
@thornjad thornjad added this to the v14.0 milestone Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement patch version Small, non-breaking, bug fix or trivial change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants