NCrunch like test automation in MVC6/DNX for Visual Studio
I love NCrunch so when I realised that it wasn’t yet supporting DNX projects, I had to figure out how to get xunit with dnx-watch working easily from Visual Studio (VS).
I already use git-bash but I can’t start dnx test or dnx-watch test from that command line to give me continuously running tests.
So here's an easy way to get a shortcut key in VS to launch cmder (so I can use git too) such that the next command I fire is dnx-watch test:
Install cmder
Set up a ALT+SPACE shortcut in VS but use the $(ProjectDir) in the Arguments field
Change the cmder startup profile to {cmd} rather than {PowerShell} as PS doesn't like the $(ProjectDir) from VS
Launch cmder from VS using ALT+SPACE
Bang out dnvm list and make sure it shows an Active version in your cmder command line (* int the Active column). If it doesn't you'll need to select one using dnvm use 1.0.0-rc1-update1 -runtime clr -architecture x86 -p or similar and then remember to restart VS for the PATH changes to take effect.
Lastly, make sure you have dnx-watch installed, open up your solution and navigate to your test project: bang out ALT+SPACE to open the CLI and pump in dnx-watch test to enjoy continuously running xunit tests.
Happy days.














