Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

NCrunch for JavaScript?
borekb
#1 Posted : Tuesday, March 13, 2012 6:30:04 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/13/2012(UTC)
Posts: 2

Was thanked: 1 time(s) in 1 post(s)
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
#2 Posted : Tuesday, March 13, 2012 9:47:00 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
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
borekb
#3 Posted : Tuesday, March 13, 2012 9:49:03 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/13/2012(UTC)
Posts: 2

Was thanked: 1 time(s) in 1 post(s)
Understood. Keep up the great work!
1 user thanked borekb for this useful post.
Remco on 3/13/2012(UTC)
orand
#4 Posted : Tuesday, June 19, 2012 10:16:03 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/19/2012(UTC)
Posts: 1

Was thanked: 1 time(s) in 1 post(s)
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 user thanked orand for this useful post.
Remco on 6/19/2012(UTC)
morrog
#5 Posted : Monday, August 20, 2012 7:11:47 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/20/2012(UTC)
Posts: 4

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
orand;2224 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 =)
1 user thanked morrog for this useful post.
Remco on 8/20/2012(UTC)
gatapia
#8 Posted : Saturday, September 8, 2012 11:00:21 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/29/2012(UTC)
Posts: 4
Location: Australia

Was thanked: 2 time(s) in 2 post(s)
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.
1 user thanked gatapia for this useful post.
Remco on 9/8/2012(UTC)
Der-Albert.com
#9 Posted : Friday, November 8, 2013 9:47:25 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/17/2011(UTC)
Posts: 209

Thanks: 11 times
Was thanked: 55 time(s) in 51 post(s)
I use Karma for running JavaScript Test Unit Tests. Works great.

http://karma-runner.github.io/

UriahB
#6 Posted : Friday, February 21, 2014 10:19:16 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/21/2014(UTC)
Posts: 2
Location: United States of America

morrog;2695 wrote:
orand;2224 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
#10 Posted : Friday, February 21, 2014 11:25:02 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
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.
UriahB
#11 Posted : Saturday, February 22, 2014 3:46:12 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/21/2014(UTC)
Posts: 2
Location: United States of America

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.
NoneError
#12 Posted : Tuesday, March 3, 2015 6:07:46 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/24/2012(UTC)
Posts: 3
Location: Canada

Thanks: 1 times
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
#13 Posted : Tuesday, March 3, 2015 9:07:32 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
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.
nportelli
#14 Posted : Thursday, May 21, 2015 5:32:01 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/7/2014(UTC)
Posts: 1
Location: United States of America

Was thanked: 2 time(s) in 1 post(s)
I'd suggest looking at http://wallabyjs.com/
2 users thanked nportelli for this useful post.
GreenMoose on 8/10/2015(UTC), sdenison on 12/9/2015(UTC)
CoolBreeze
#16 Posted : Monday, January 30, 2017 12:31:09 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 7/11/2014(UTC)
Posts: 79
Location: United States of America

Was thanked: 9 time(s) in 9 post(s)
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
GreenMoose
#17 Posted : Wednesday, February 15, 2017 7:38:55 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/17/2012(UTC)
Posts: 507

Thanks: 145 times
Was thanked: 66 time(s) in 64 post(s)
@CoolBreeze: That sounds very interesting, do you have more details of this? an upcoming blog post maybe? :)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.117 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download