I have to say that in a long time no other tool had such a positive impact on my coding experience inside Visual Studio - NCrunch is simply fantastic!
As I'm doing more client-side development these days I wanted to ask if there is a chance that NCrunch will be able to understand and execute JavaScript tests one day? I know it's too early to ask, JavaScript itself doesn't have first-class support in Visual Studio and various test runners yet but at least I thought I would express my interest. JavaScript support in NCrunch would rock.
Remco NCrunch Developer
#1441
13 Mar 2012 21:47 UTC
Hi, thanks for posting and I'm glad your enjoying NCrunch!
Right now I have no short term plans for implementing javascript support with NCrunch. This may change in future, but it would take considerable investment to implement.
Cheers,
Remco
Right now I have no short term plans for implementing javascript support with NCrunch. This may change in future, but it would take considerable investment to implement.
Cheers,
Remco
Understood. Keep up the great work!
Perhaps the Chutzpah JavaScript test plugin for Visual Studio 2012 can be used to jumpstart this effort.
http://www.peterprovost.org/blog/2012/06/15/anatomy-of-a-file-based-unit-test-plugin/
http://www.peterprovost.org/blog/2012/06/15/anatomy-of-a-file-based-unit-test-plugin/
Edited 19 Jun 2012 22:16 UTC
orand wrote:Perhaps the Chutzpah JavaScript test plugin for Visual Studio 2012 can be used to jumpstart this effort.
http://www.peterprovost.org/blog/2012/06/15/anatomy-of-a-file-based-unit-test-plugin/
+1
Also you can look at Unit-testing-JavaScript-as-part-of-TFS-Build where Matt describes how to run Chutzpah from an MsTest.
This is how I use Ncrunch to run Js tests atm =)
Deleted post
#2771
06 Sep 2012 02:15 UTC
What I would really love to see is a simple plugin system to implement JS unit test runners. You just need to have an instance of PhantomJS running in the background and poll the plugins. For instance have an interface like:
interface IJSTestSuite
ICollection<string> GetTestCases();
ICollection<string> GetTests(string testCase);
ICollection<string> GetTestsThatNeedRuning(ICollection<string> filesChanged);
ICollection<ITestResult> RunTests(ICollection<string> testsToRun);
You would probably need to provide a base class or a Utility class where you can get a hold of a clean phantomJS instance and let the plugin writers do their thing.
The reason I think a plugin system works best is that there are so many JS libs / test runners, etc out there and you would never be able to meet all needs. For instance I need a Closure Library test runner and I don't expect anyone to build this but I would be more than happy to implement it myself given a nice platform to do it on.
I've actually made two attempts at this the first is:
https://github.com/gatapia/jish
The second is a Resharper plugin, but resharper plugins are sooooo convoluted that I gave that up after a short and painful time.
Anyways, my 2 cents about JS continous testing.
interface IJSTestSuite
ICollection<string> GetTestCases();
ICollection<string> GetTests(string testCase);
ICollection<string> GetTestsThatNeedRuning(ICollection<string> filesChanged);
ICollection<ITestResult> RunTests(ICollection<string> testsToRun);
You would probably need to provide a base class or a Utility class where you can get a hold of a clean phantomJS instance and let the plugin writers do their thing.
The reason I think a plugin system works best is that there are so many JS libs / test runners, etc out there and you would never be able to meet all needs. For instance I need a Closure Library test runner and I don't expect anyone to build this but I would be more than happy to implement it myself given a nice platform to do it on.
I've actually made two attempts at this the first is:
https://github.com/gatapia/jish
The second is a Resharper plugin, but resharper plugins are sooooo convoluted that I gave that up after a short and painful time.
Anyways, my 2 cents about JS continous testing.
I use Karma for running JavaScript Test Unit Tests. Works great.
http://karma-runner.github.io/
http://karma-runner.github.io/
morrog wrote:orand wrote:Perhaps the Chutzpah JavaScript test plugin for Visual Studio 2012 can be used to jumpstart this effort.
http://www.peterprovost.org/blog/2012/06/15/anatomy-of-a-file-based-unit-test-plugin/
+1
Also you can look at Unit-testing-JavaScript-as-part-of-TFS-Build where Matt describes how to run Chutzpah from an MsTest.
This is how I use Ncrunch to run Js tests atm =)
Morrog (or anyone else) Can you provide some details on how to get NCrunch to see the Chutzpah tests? When I "Run all tests in solution" with MSTest they run, but when NCrunch scans assemblies it doesn't see my Jasmine tests. I poked around in the config but don't see any way to get NCrunch to change how it "detects" tests to run. Any guidance is appreciated.
Thanks,
Uriah
Remco NCrunch Developer
#5369
21 Feb 2014 23:25 UTC
Hi Uriah -
Sorry. The parsing and execution of JavaScript is not currently supported by NCrunch. As far as I know, the only way to make NCrunch run JavaScript tests is by introducing a .NET wrapper that can call into a JavaScript command line executable.
Sorry. The parsing and execution of JavaScript is not currently supported by NCrunch. As far as I know, the only way to make NCrunch run JavaScript tests is by introducing a .NET wrapper that can call into a JavaScript command line executable.
That's kind of what I thought but it sounded like Morrog had gotten it working somehow. If NCrunch could pick up chutzpah tests, that would be killer.
Is there any new news on this front? Will there be js support in NCrunch one day? Has anyone found a way to wire it up (like Morrog eludes too)?
Remco NCrunch Developer
#7047
03 Mar 2015 21:07 UTC
Hi,
I'm sorry to say that I have no news on this right now other than to reflect my understanding of the obvious: that lots of people want this
Implementing Javascript support in NCrunch is a major piece of work. It's a whole new runtime environment that would need a new range of services, including instrumentation etc. It's also quite a high-risk area of work, as I'm not yet sure what the limitations of this runtime environment would be like or how to best integrate it with the engine.
I'm sorry to say that I have no news on this right now other than to reflect my understanding of the obvious: that lots of people want this
Implementing Javascript support in NCrunch is a major piece of work. It's a whole new runtime environment that would need a new range of services, including instrumentation etc. It's also quite a high-risk area of work, as I'm not yet sure what the limitations of this runtime environment would be like or how to best integrate it with the engine.
I'd suggest looking at http://wallabyjs.com/
Deleted post
#8745
20 May 2016 03:51 UTC
Short Answer: I use the JInt JavaScript Interpreter engine in Visual Studio.
I had to design some libs to combine the JavaScript files needed for the test, create the JS test function call, get the Jint Engine completion values, dump out error messages, etc.
Once I got those libs working takes me a few minutes to create a new test and have NCrunch run the tests.
Ed
I had to design some libs to combine the JavaScript files needed for the test, create the JS test function call, get the Jint Engine completion values, dump out error messages, etc.
Once I got those libs working takes me a few minutes to create a new test and have NCrunch run the tests.
Ed
@CoolBreeze: That sounds very interesting, do you have more details of this? an upcoming blog post maybe? :)
Post a reply
Log in to reply.