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

fix #418 test for fsPromises.truncate(path[, len]) #496

Closed
wants to merge 2 commits into from

Conversation

deepanjali19
Copy link
Contributor

This fixes the issue #418.

There is now a test available for fsPromises.truncate(path[, len]) .

It checks if the length of the file is negative, and sends an error message.

var fsPromises = util.fs().promises;
var contents = 'This is a file.';

return fsPromises.writeFile('/myfile', contents)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be a return @deepanjali19?

Copy link
Contributor

Choose a reason for hiding this comment

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

It does, so that the containing test gets a Promise it can use to know when the test is complete. With callback based tests you don't need to; but with Promise based ones you do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you @humphd for explaining it better than I could have.

@humphd
Copy link
Contributor

humphd commented Oct 9, 2018

@deepanjali19 this looks good, we just need to resolve this merge conflict. Let's do it in class tomorrow together.

@deepanjali19
Copy link
Contributor Author

Sure @humphd !

@humphd
Copy link
Contributor

humphd commented Dec 15, 2018

Rebased and merged in 94fd5ba. Closing.

@humphd humphd closed this Dec 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants