Created
August 18, 2018 15:26
-
-
Save jfornoff/f8e7c9b426121a079ed7d590220891e9 to your computer and use it in GitHub Desktop.
Function that allows using vim-test inside umbrella projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! UmbrellaElixirTestTransform(cmd) abort | |
if a:cmd !~ 'apps/' | |
return a:cmd | |
endif | |
let testCommand = join(split(a:cmd)[0:-2]) | |
let umbrellaTestFilePath = split(a:cmd)[-1] | |
let pathFragments = split(umbrellaTestFilePath, "/") | |
let appName = pathFragments[1] | |
let localTestPath = join(pathFragments[2:], "/") | |
return join(["mix cmd --app", appName, testCommand, localTestPath]) | |
endfunction | |
let g:test#custom_transformations = {'elixir': function('UmbrellaElixirTestTransform')} | |
let g:test#transformation = 'elixir' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment