I have been trying to set up a shortcut for jumping between a JavaScript implementation and test. I have particular requirements that are making examples I see harder to apply.
I currently work with many very small javascript projects. The structure of the project normally has its tests in a mirrored directory structure (like so: )
lib/foo.js
lib/someDir/bar.js
test/fooSpec.js
test/someDir/barSpec.js
So the spec files are not in the same directory, as the implementation
I first was looking at examples for ff-find-other-file
, but they were for situations when the files were located in the same directories. I'm looking to configure it a little more dynamically (walking up the directory tree until lib, then adding a similar path with test replacing lib)
I also know projectile has a function for doing just this. I use projectile in my setup, but when attempting to use its built in method (C-c p t) I get the message "Project type not supported!". Interestingly enough, projectile is able to list all my test files via (C-c p T). Is there way of configuring projectile for javascript, so that it knows how to find a corresponding spec file?
I also saw the project toggle test, but am looking for a more automatic solution. It requires a configuration for each project to enable toggling between tests. This is rather inconvenient to me because when working with Node/JS I bounce between many projects (it's very common to divide an application into many very small projects with their own tests). I also often look at external dependencies, and then their specs. More often then not they have this structure. Having to configure toggle test each time I need to use this feature makes it not very useful.
ff-search-directories
variable provides limited functionality for finding files in other directories (albeit not arbitrary directory walking). See stackoverflow.com/questions/23660637/smarter-ff-find-other-file – phils Jan 12 '15 at 20:54