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 Issue 410 add test for fs.rename() when file or directory to rename doesn't exist #413

Closed
wants to merge 6 commits into from

Conversation

Projects
None yet
4 participants
@itchylol742
Copy link

commented Sep 19, 2018

This adds a test for fs.rename() which expects an error when trying to rename a file/directory that doesn't exist.

it('should return error if the file or directory to rename doesnt exist', function(done) {
    var fs = util.fs();
      fs.rename('/fakeDirectory', '/myotherdir', function(error) {
        expect(error).to.exist;
        done();
      });
  });

fs.rename('/fakeDirectory', '/myotherdir', function(error) {
expect(error).to.exist;
done();

This comment has been minimized.

Copy link
@giantpanpan

giantpanpan Sep 27, 2018

Contributor

Great Job! @itchylol742
I just want to add one my opinion that if you want to test the existing of a path/file,
it might be a good way to add:

expect(error.code).to.equal('ENOENT');

Thank you :)

@humphd

This comment has been minimized.

Copy link
Contributor

commented Oct 9, 2018

@itchylol742 This can't be merged in its current form: you've got changes to unrelated files, and tons of whitespace changes. I'm going to close this, and if you want to file a new PR with just your test changes, that would be great.

@humphd humphd closed this Oct 9, 2018

@itchylol742 itchylol742 deleted the itchylol742:issue-410 branch Oct 9, 2018

@itchylol742 itchylol742 restored the itchylol742:issue-410 branch Oct 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.