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

Add .to.be.a.symlink() support. Closes #3 #4

Merged
merged 2 commits into from Oct 22, 2014
Merged

Add .to.be.a.symlink() support. Closes #3 #4

merged 2 commits into from Oct 22, 2014

Conversation

d13r
Copy link
Contributor

@d13r d13r commented Sep 27, 2014

I haven't written any unit tests for it because I can't work out how to get the test suite to work - it always fails with some rather strange errors:

[...]

308:  path_exist.js invalid data (bad value type) should fail when negated assert (with message)

      failed but expected message 'My Message: value: expected 123 to be a string' to equal 'My Message: function (data) {\n      return render.call(this, data, _);\n    }'
         at Assertion.<anonymous> (/home/dave/chai-fs/test/tester.js:34:10)
         at Assertion.ctx.(anonymous function) [as failCall] (/home/dave/chai-fs/node_modules/chai/lib/chai/utils/addMethod.js:40:25)
         at Context.<anonymous> (/home/dave/chai-fs/test/tester.js:113:13)

      -  My Message:    function (data) {\n
        "||||||||||||+++-|-----------------"
      +  My Message: val u

               re turn re  nder.call(t his, data,    _);\n
        "-------|+----|-|++--|--|----|+-----|----|+++-----"
                e:      exp  e  c    te     d     123

                        }
        "|++|++|+|++++++-"
          to be a string

-> failed 308 and passed 86 of 394 tests, left 28 pending (818ms)

Warning: Task "mochaTest:pass" failed. Use --force to continue.

Any suggestions?

Bartvds added a commit that referenced this pull request Oct 1, 2014
@Bartvds
Copy link
Contributor

Bartvds commented Oct 1, 2014

Sorry for the late reply but I had to sit down properly to spot this.

Apparently the underscore devDependency broke semver and crashed the tester. In my working dir I used version 1.6.0 (and still have) but I had it on ^1.6.0, so on a fresh npm install you'd get a 1.7.0 and then it breaks.

I updated the package.json to reflect this, but you can easily change it in your fork.

@d13r
Copy link
Contributor Author

d13r commented Oct 1, 2014

Thanks, I'll have another go at it soon.

@d13r
Copy link
Contributor Author

d13r commented Oct 9, 2014

I've updated it with passing unit tests. I had to use a bit of a workaround to allow broken symlinks (where the target doesn't exist) to pass while throwing an error if the symlinks themselves don't exist - if you can think of a better way let me know. Thanks.

Bartvds added a commit that referenced this pull request Oct 22, 2014
Add .to.be.a.symlink() support. Closes #3
@Bartvds Bartvds merged commit 837694b into chaijs:master Oct 22, 2014
@Bartvds
Copy link
Contributor

Bartvds commented Oct 22, 2014

I merged this finally but on my windows machine the test fail.

I think it is because the symlink doesn't travel well over git (I never tried that).

But we can just create a link in the test right?

@d13r
Copy link
Contributor Author

d13r commented Oct 22, 2014

I haven't tried it on Windows but I think Git will just make a copy of the file. Could try creating the link in the test setup as you say - but I think that requires admin privileges on Windows so they would have to be run in an elevated command prompt instead. Alternatively skip them on Windows?

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

2 participants