0

I have been writing tests of one sort or another for my software for nearly 30 years, but am scratching my head at this one, I must have missed something really obvious.

I have a .Net ASP MVC Web app, developed with VS2015, in which I have written some library javascript code. I would like to have some simple tests for this javascript code that I can run in my dev environment, on my own machine. I have no IIS server locally. (The server side code is fine, I use NUnit and VSs Testrunner).

I have read about Mocha (and used it back end), QUnit etc - but anything whose installation and use instructions start npm install and talks about running grunt jobs is not what I am after.

Can someone point me in the right direction / educate me? At the moment, I am just dumping stuff into JSBin and handcrafting tests...

EDIT: To be clearer, it is not npm per se that is the issue. It is more I want a standalone tool that I download (and run off the commandline), or something that integrates into Visual Studio. I am after "the NUnit experience" if that makes any sense? –

1

Mocha, Jasmine and Enzyme are the best server and client (w/ mockup browsers API's) sided test libraries for JavaScript, but they do indeed require npm. Something that might be of interest to you is SonarQube's SonarJS. It supports Backbone, amd modules, jQuery and has some form of browser mockup support. It does require multiple installations, but if you do not like to use npm, this might be a good alternative.

  • It is not npm per se that is the issue. It is more I want a standalone tool that I download (and run off the commandline), or something that integrates into Visual Studio. I am after "the NUnit experience" if that makes any sense? – kpollock Jul 6 '17 at 14:46
  • 1
    SonarJS is a standalone application that runs on a SonarQube server, I don't know if it has any options to run from commandline. The Jasmine framework is able to integrate into VS2017, I'd figure it should work with VS2015 and service pack update 2 or 3. – Shane van den Bogaard Jul 6 '17 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.