unit testing ajax in .net - javascript

How you test ajax? What do you use?
Share information.
For me, testing ayah was torture.
I'm using jsUnit and mockajax but, nothing works...
help me please.

I know this question is a bit old, but I just wrote a framework for doing JavaScript unit testing (and coverage) in .net. So just write your ajax unit tests in what ever JS framework u want (like qUnit, JSUnit, closure, etc) and use my project to provide bindings to .Net. Allows you to use Visual Studio and your standard CI tools to run your tests.
https://github.com/gatapia/js.net
Let me know what u think.
Thanks
Guido

Related

Is it possible to use Testacular for non-AngularJS app for end-to-end testing

I'm building a simple app and want to use Testacular as the test runner. Testacular is simple to setup for unit testing but the possibility of using it for e2e also seems great, however my app will not be in AngularJS. Is this possible (or simple) to do or should I be looking more towards Selenium?
Yep! From Testacular's GH Page:
Testing Framework Agnostic
Describe your tests with Jasmine, Mocha, QUnit. Or write a simple adapter for any framework
you like.
Since the aforementioned testing frameworks aren't library-dependent, it would make sense that as long as you can test your library code using one of those frameworks you can use testacular to provide a test-runner for it.
That being said testacular is not selenium. It allows you to test your code in a browser environment but as far as I know doesn't provide navigation, DOM Querying, user-emulation etc. like selenium does. If you're looking for selenium functionality for your JS code you should check out Soda which is an awesome library written by TJ and the rest of the gods on Mt. Olympus ::cough:: I mean developers at LearnBoost that provides a JS adapter for selenium's wire protocol, among other things.
But if you still think testacular is the way to go then take a look at their sample configuration file which should get you started in the right direction. Hope this helps!

Integration testing for Javascript Code

I've written a lot of javascript code that interacts with a number of different web services. I now need to write integration testing code for it. My experience with integration testing is limited. Could anyone recommend some good tools and online tutorials?
look at this post this may help you i guess... http://robots.thoughtbot.com/post/4026880618/javascript-integration-testing-example-installing-and
We use cucumber http://cukes.info/ so we create functional testing that tests integration with server too.
cucumber runs with ruby, if you want to do it with JS try cucumberjs or a combination of zombiejs and jasminejs. NodeJS required

Continuous JavaScript Testing

Does anyone know of a good JavaScript testing tool which integrates automated testing with your Testing Framework of Choice. I am aware of TestSwarm (which is not automated testing) and Travis-CI (which isn't really available for closed-source projects).
Any other ones out there?
You can use Selenium:
Its test can either be generated by its IDE, or can be written in high level languages such as Java, PHP, etc.
Its can be instantiated from a Command-Line.
Its can be integrated with continuous-integration servers like Jenkins (In-build plugin).
The fact, that it can be instantiated from command-line (preferably written in java), makes it integrable by any CI Server
Two that I know of (although I'm not sure they are really meant for this purpose...) are Simple Test js and the MIT project Sikuli. Sikuli is great for making a cursor click on things and test out the user interactions. Neither one of these naturally will integrate well with your testing framework of choice but they will certainly allow you to write unit tests. Hopefully someone else will know of a better solution.

Using Javascript/jQuery is there any reason you would use YUITest over QUnit as a testing framework?

Hi i'm starting a new website and am going to be using jQuery as the library in the browser.
I was looking at testing frameworks and the obvious choice for Unit Testing in jQuery is the framework jQuery itself provides which is QUnit.
I have also looked a little at YUITest which looks very well documented. So my question is.
If you are programming the clientside in Javascript/jQuery is there any
reason one would use YUITest over QUnit as a testing framework?
Yui test is providing much more features than qunit, eg. asynchronous testing and also mocking.
Also the documentation is far better.
It's really worth to have a look at Yui test.

Looking for Info on a Javascript Testing framework

Hi Can somebody fill me in on JavaScript Testing Frameworks?
I'm working on a project now and as the JS (Mostly jQuery) libraries grow, it's getting more and more difficult to introduce change or refactor, because I have no way of guaranteeing the accuracy of the code without manually testing everything.
I don't really know anything about JavaScript Testing Frameworks, or how they integrate/operate in a .Net project, so I thought I'd ask here.
What would a good testing framework be for .Net?
What does a JavaScript test look like? (e.g. with NUnit, I have [TestFixture] classes & [Test] methods in a ProjectTests assembly)
How do I run a javascript test?
What are the conceptual differences between testing JS & testing C#?
Is there anything else that would be worth knowing?
Thanks
Dave
As for jQuery testing(and Javascript testing in general) you should maybe take a look at QUint, jQuerys testing suite. You simply include a couple of javascript-files, and a css-stylesheet, write your testes in the same document(or if you want to include them of course), and open the document. The testing framework sets up the page, and lets you run the test.
As for implementation with C# and .Net I can't help you.
Already lot of questions (and replies) about this subject on stack overflow:
The most complete: What are some JavaScript Unit Testing and Mocking Frameworks you have used?
Looking for a better JavaScript unit test tool
Javascript Unit-testing?
You should at least be aware of jsUnit.

Categories

Resources