To debug, I added the following statements to a number of internal AVA files:
On Node 5, when everything works, I get this output:
/~/dev/ava/lib/fork.js
/~/dev/ava/lib/test-worker.js
/~/dev/ava/lib/test-worker.js
/~/dev/ava/lib/test-worker.js
/~/dev/ava/lib/test-worker.js
/~/dev/ava/index.js
/~/dev/ava/index.js
/~/dev/ava/index.js
/~/dev/ava/index.js
/~/dev/ava/index.js
On Node 6, where things are broken:
/~/dev/ava-codemods/node_modules/ava/lib/fork.js
/~/dev/ava/lib/test-worker.js
/~/dev/ava/lib/test-worker.js
/~/dev/ava/lib/test-worker.js
/~/dev/ava/lib/test-worker.js
/~/dev/ava-codemods/node_modules/ava/index.js
/~/dev/ava-codemods/node_modules/ava/index.js
/~/dev/ava-codemods/node_modules/ava/index.js
/~/dev/ava-codemods/node_modules/ava/index.js
/~/dev/ava-codemods/node_modules/ava/lib/test-worker.js
/~/dev/ava-codemods/node_modules/ava/lib/test-worker.js
/~/dev/ava-codemods/node_modules/ava/lib/test-worker.js
/~/dev/ava-codemods/node_modules/ava/index.js
/~/dev/ava-codemods/node_modules/ava/lib/test-worker.js
So, it appears that, in Node 6, npm linked modules think they are inside the node_modules folder of the project from which they are linked, instead of their actual path on the file system.
However, when we fork test-worker.js, it is aware of it's actual path. But that gets confused when when the user does require('ava') and the file paths show as nested again.
You will notice test-worker shows up twice as often as it should, with a deeper path the second time around.
To debug, I added the following statements to a number of internal AVA files:
On Node 5, when everything works, I get this output:
On Node 6, where things are broken:
So, it appears that, in Node 6, npm linked modules think they are inside the
node_modulesfolder of the project from which they are linked, instead of their actual path on the file system.However, when we fork
test-worker.js, it is aware of it's actual path. But that gets confused when when the user doesrequire('ava')and the file paths show as nested again.You will notice
test-workershows up twice as often as it should, with a deeper path the second time around.