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

Continue fs-extra migration #1

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions spec/create.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ var project = path.join(tmpDir, appName);

// Setup and teardown test dirs
beforeEach(function () {
fs.removeSync(project);
fs.ensureDirSync(tmpDir);
fs.emptyDirSync(tmpDir);
});
afterEach(function () {
afterAll(function () {
Copy link
Owner

Choose a reason for hiding this comment

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

Why this change and why here?

Copy link
Author

@raphinesse raphinesse May 29, 2018

Choose a reason for hiding this comment

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

Why: Since with emptyDirSync we empty tmpDir in beforeEach so there's no need to delete the tmpDir itself after every test, only at the very end.

Why here: Because this change is kind of enabled by the rich fs-extra API 🤷‍♂️

process.chdir(path.join(__dirname, '..')); // Needed to rm the dir on Windows.
fs.removeSync(tmpDir);
});
Expand Down