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

move.test failing on windows platform #188

Closed
bartland opened this issue Oct 31, 2015 · 2 comments · Fixed by #189
Closed

move.test failing on windows platform #188

bartland opened this issue Oct 31, 2015 · 2 comments · Fixed by #189

Comments

@bartland
Copy link
Contributor

There are 7 tests which fail on windows but work on Linux.
This is because when git fetches the test data files it converts the line endings from \n to \r\n (since core.autocrlf is typically true with git on windows).

This fails on Windows but succeeds elsewhere:

        assert.ifError(err)
        assert.strictEqual(contents, 'sonic the hedgehog\n')

I believe the best way to fix this is to use regex:

        var expected = /^sonic the hedgehog\r?\n$/
        assert.ifError(err)
        assert.ok(contents.match(expected), contents + ' match ' + expected)
@jprichardson
Copy link
Owner

Interesting. It's not failing on the Windows Appveyor tests: https://ci.appveyor.com/project/jprichardson/node-fs-extra/branch/master Why do you think that is? Either way, I'm fine with changing it. Really, could just trim the line ending, as it's not that important for that particular test.

@bartland
Copy link
Contributor Author

Probably because Appveyor is preserving the repository line endings. I think regex is a bit cleaner as it doesn't modify data. I'll submit a PR for this shortly.

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 a pull request may close this issue.

2 participants