You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A check for symlinks could be useful. As a starting point, this is what I'm currently using (CoffeeScript):
fs=require('fs')
module.exports= (chai, utils) -># expect(path).to.be.a.symlink()# expect(path).not.to.be.a.symlink()chai.Assertion.addMethod'symlink', ->tryisSymlink=fs.lstatSync(this._obj).isSymbolicLink()
catch err
# If it doesn't exist, it's clearly not a symlinkiferr.code=='ENOENT'isSymlink=falseelsethrow err
this.assert(
isSymlink,
'expected #{this} to be a symlink',
'expected #{this} not to be a symlink'
)
The text was updated successfully, but these errors were encountered:
A check for symlinks could be useful. As a starting point, this is what I'm currently using (CoffeeScript):
The text was updated successfully, but these errors were encountered: