Closed nerdgore closed 8 years ago
AVA already handles using the local version when available. The correct change would be to use the AVA version that is the dependency of this plugin, instead of the globally installed one. This should wait until https://github.com/avajs/atom-ava/pull/18, as that PR touches the same code.
Ah okay, I missed this in the documentation. So if I understand correctly if atom-ava/node_modules/.bin/ava
is used it will figure out that I have my_open_atom_project/node_modules/.bin/ava
and use this instead? If so this PR will be obsolete.
@nerdgore - Actually, AVA itself already handles this here.
Great. Thank you. So everything I asked for is already there, it's just that for the time being I need AVA globally.
it's just that for the time being I need AVA globally.
Ah. I see what you are getting at now. In that case, I think this PR still has merit then.
I would prefer it was redone to mimic how AVA itself locates the local install (see linked code above).
@jamestalmage I've already outlined what needs to be done in https://github.com/avajs/atom-ava/pull/20#issuecomment-224618995. AVA is a dependency on this plugin, so we just need to use it instead of the global.
If ava is installed as a module, use this over the globally installed instance. An improvement on this PR would be to even add this as an option in the plugin UI. Fixes #19
I am not quite sure if spying on
fs.existsSync
is the proper way to implement the test for this. I am open for suggestions.