JavaScript for Line of Business Applications
596.1K views | +0 today
Follow
JavaScript for Line of Business Applications
Keeping track of current JavaScript Frameworks that help design your clientside Business Logic Layers.
Curated by Jan Hesse
Beam to my Inbox:
Your new post is loading...
Your new post is loading...

Popular Tags - Filter using the Funnel

Current selected tags: 'jQuery', 'testing'. Clear
Scoop.it!

jquery-mockjax

jquery-mockjax | JavaScript for Line of Business Applications | Scoop.it
jquery-mockjax - The jQuery Mockjax Plugin provides a simple and extremely flexible interface for mocking or simulating ajax requests and responses
No comment yet.
Scoop.it!

Unit Testing JavaScript/JQuery in ASP.Net MVC Project using QUnit Step by Step

Unit Testing JavaScript/JQuery in ASP.Net MVC Project using QUnit Step by Step | JavaScript for Line of Business Applications | Scoop.it

The latest Razor View Model of ASP.Net MVC 3/MVC 4 uses considerable amount of JavaScript/JQuery. Sometimes the ActionResult returned by the Controller methods are refined further using JQuery methods before the result in the view. It’s very common when we are returning JSON formatted output from the controller method.

We have various options to run the unit test on the .Net code written within controller. But sometimes it’s required to test those JavaScript/JQuery codes as well, to check the sanity of the output especially in the situation mentioned above.

QUnit (http://nuget.org/packages/QUnit-MVC, a NuGet package) can help us to run such Unit Test.

No comment yet.
Scoop.it!

chai-jq - jQuery Assertions for Chai

Chai is a wonderful JavaScript test assertion library that I rely on extensively (usually using it in conjunction with the Mocha test framework library). Chai has an intuitive, natural-language approach to assertions that enables you tests to read almost like an English narrative. Chai also supports plugins which extend the base assertion API.

Chai is quite often used for frontend JavaScript testing, and specifically for testing jQuery elements in an application web page. There is an existing chai-jquery plugin for Chai, which is extensive and really quite neat. Unfortunately, it has a few issues with overriding built-in Chai assertions like have and length in ways that changes the underlying Chai API.

With that motivation in mind, I hacked together a quick jQuery plugin, chai-jq for Chai that has a separate $-prefixed namespace to avoid collisions with existing Chai assertions, and put the project up on GitHub.

No comment yet.