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
returns /var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T with os.tmpdir()
but this directory is a symlink for /private/var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T
as a consequence all filename passed to testExclude.shouldInstrument() will start with /private/var/..., while options.cwd() will start with /var/..., even though it's the same folder.
One possible solution would be to run fs.realpath() on both filename and options.cwd() before comparing them.
The text was updated successfully, but these errors were encountered:
TextExclude.shouldInstrument(filename)
returnsfalse
whenoptions.relativePath
istrue
andfilename
is not insideoptions.cwd
.However:
options.cwd
is a symlink and is passed with its symlink unresolvedfilename
resolves the symlink (throughfs.realpath()
for example)shouldInstrument()
will returnfalse
even though it should returntrue
.This is likely to happen since:
nyc
always has symlinks resolved because that's howmodule._compile()
worksnyc
user might pass aoptions.cwd
that has an unresolved symlink.Real-life example: running the following on Travis on Mac OS:
Travis Mac OS environment:
/var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T
withos.tmpdir()
/private/var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T
filename
passed totestExclude.shouldInstrument()
will start with/private/var/...
, whileoptions.cwd()
will start with/var/...
, even though it's the same folder.One possible solution would be to run
fs.realpath()
on bothfilename
andoptions.cwd()
before comparing them.The text was updated successfully, but these errors were encountered: