-
Notifications
You must be signed in to change notification settings - Fork 29
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
.to.not.be.a.file() not working #9
Comments
Same issue here except using format:
This results in the error:
...I did some digging and everything seems to be in order; however, it appears that somewhere along the line the method is mapped to the isFile method (or some other method that expects it to exists as opposed to not exist). Cheers! Kyle |
I am also experiencing this issue:
throws error:
Any ideas? :( |
@stefanwalther @ktyacke @embpdaniel After reviewing the code and associated tests, it appears to me that this behavior was intentional.
That's why you're getting the message "expected path to exist" when you're asserting a non-existent path Therefore, in most cases, what you probably want to do is change your assertion to: expect(<path>).to.not.be.a.path(); There doesn't appear to be a single assertion that allows you to test that a given path either doesn't exist or it does exist but isn't a file. Personally, I probably would've preferred |
Holy hell, I've been fighting with this all day What a stupid function that clearly does not behave as most would intend. At least I can confirm @meeber solution works. |
I hit this also. Maybe docs might want to note this behavior :) |
Goodness. I've also just spent the best part of the last hour trying to figure out why my code was broken -- when it's not. It's this flipping assertion. Yes, @meeber's fix works, but a path which doesn't exist is not a file (or directory). This function really should not fail for a non-existent path! |
.to.not.be.a.file()
does not work, returns true, even if the file is not existing, example:... but the file is definitely not there ... but throws an asserting exception.
The text was updated successfully, but these errors were encountered: