JavaScript for Line of Business Applications
596.1K views | +0 today
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 tag: 'testing'. Clear
Scoop.it!

Testing AngularJS Directives: Handling External Templates

Testing AngularJS Directives: Handling External Templates | JavaScript for Line of Business Applications | Scoop.it

AngularJS provides support for testing directives.  Testing directives that use inline templates -- html that is embedded within the directive's code -- is a straightforward process.  What isn't straightforward is testing a directive that uses an external html template.

No comment yet.
Scoop.it!

Writing javascript tests with tape

Writing javascript tests with tape | JavaScript for Line of Business Applications | Scoop.it

This guide shows how to write javascript tests with a minimal test api that works in both node and browsers.

This guide covers the ins-and-outs of tape, a simple TAP-producing test library for node and browsers. The tape API is a small superset of the node core assert module.

This guide was written for Testling. Testling lets you write continuous integration cross-browser tests that run on every git push! Once the tests run you get a badge you can put in your readme with the current browser test status. Here's how it looks:

No comment yet.
Scoop.it!

Using QUnit for JavaScript unit test and BlanketJS for code coverage

Using QUnit for JavaScript unit test and BlanketJS for code coverage | JavaScript for Line of Business Applications | Scoop.it

I recently started using QUnit for unit testing JS code and I’m really impressed with it. I’m sure Jasmine framework is equally good, but I picked up QUnit because none of the languages/frameworks I have learned so far have the letter ‘Q’ in them!!

So I have a simple page which is used to add two numbers and show the sum as a text.

No comment yet.
Scoop.it!

What should I test when I write software?

What should I test when I write software? | JavaScript for Line of Business Applications | Scoop.it

Testing is really important when you write software. That is a fact. But the real question is what you should test. The simple answer is "everything possible."

A more fleshed out answer is that you should also avoid testing the same things multiple times.

For example, if you are testing your server-side API on the server, it would be redundant to test the entire API with client-side ajax calls as well.

Here are some of the basic places where tests are most important during the application life-cycle.

No comment yet.
Scoop.it!

Advanced Unit Testing Techniques in JavaScript

Advanced Unit Testing Techniques in JavaScript | JavaScript for Line of Business Applications | Scoop.it

By now, everyone knows about Test-Driven Development and unit testing. But are you using the testing frameworks to their fullest?

In this tutorial, I’ll introduce you to some of the more advanced techniques available to you.

As this tutorial will cover some advanced topics, I assume you’ve already created unit tests before and are familiar with the basics and its terminology. If not, here’s an excellent article to you get started: TDD Terminology Simplified.

We’ll be using SinonJS. This is a standalone framework which provides an API for mocks, stubs, spies and more. You can use it with any testing framework of your choosing, but for this tutorial, we’ll be using BusterJS, as it ships with SinonJS built-in.

No comment yet.
Scoop.it!

Test Driven Development with KnockoutJS, VisualStudio, and Karma

Test Driven Development with KnockoutJS, VisualStudio, and Karma | JavaScript for Line of Business Applications | Scoop.it

I’m giving a presentation on KnockoutJS and TDD at DevTeach in Toronto on Wednesday. I’ll be doing a live code demo, which is always exciting (at least for the presenter). I thought I’d write a quick article recording the steps I go through as part of the demo.


With a proper suite of unit tests in place, it’s much safer to make changes. It took me way too long to realize this, but the easiest way to make sure you have a great suite of unit tests is to practice some form of Test Driven Development (TDD) or Behavior Driven Development (BDD). Since you write the tests first in these practices, you never have to go back and try to shoe horn your code in to a test harness. Also, if you wrote the tests before the code, you wrote the tests already, so there’s no risk you’re going to skip them when the schedule gets tight.

No comment yet.
Scoop.it!

Full-Spectrum Testing with AngularJS and Karma

Full-Spectrum Testing with AngularJS and Karma | JavaScript for Line of Business Applications | Scoop.it
Learn how to fully test your AngularJS application with Karma in every possible area using E2E, Unit and Midway testing

 

How do you setup your test environment? How should you organize your code? How do you setup a runner and how to automate the process? The bigger question is how do you usually test your JavaScript code?

You may also be wondering what exactly to test in your application? What should my tests really look for? How should I write my specs? As you can see there are many questions to answer.

It doesn't take much time to realize that testing JavaScript is difficult and finicky. However, if you wish to get arobust understanding of how to properly test your JavaScript code within your AngularJS application, then continue and read along... :)

No comment yet.
Scoop.it!

Writing Testable JavaScript

Writing Testable JavaScript | JavaScript for Line of Business Applications | Scoop.it

We’ve all been there: that bit of JavaScript functionality that started out as just a handful of lines grows to a dozen, then two dozen, then more. Along the way, a function picks up a few more arguments; a conditional picks up a few more conditions. And then one day, the bug report comes in: something’s broken, and it’s up to us to untangle the mess.

As we ask our client-side code to take on more and more responsibilities—indeed, whole applications are living largely in the browser these days—two things are becoming clear. One, we can’t just point and click our way through testing that things are working as we expect; automated tests are key to having confidence in our code. Two, we’re probably going to have to change how we write our code in order to make it possible to write tests.

No comment yet.
Scoop.it!

Blanket.js | Seamless javascript code coverage

Seamless javascript code coverage. Easy to install, easy to configure, easy to use on client side and node.js. Blanket.js is an open source project created by Migrii Team.
No comment yet.
Scoop.it!

Superhero.js

Superhero.js | JavaScript for Line of Business Applications | Scoop.it

Creating, testing and maintaining a large JavaScript code base is not easy, especially since great resources on how to do this are hard to find. Superhero.js is a collection of the best articles, videos and presentations on creating, testing and maintaining large JavaScript applications.

This page is a continously updated list of articles that help explain the syntax of JavaScript, how to organize your projects, how to test your code, and what’s on the horizon. Have fun!

 

No comment yet.
Scoop.it!

Approaches to Testing Modern Web Applications

Approaches to Testing Modern Web Applications | JavaScript for Line of Business Applications | Scoop.it

As I was learning how to design and execute load tests, an experienced load tester told me the one rule you needed to be able to judge the effectiveness of a test execution: If something didn’t go wrong with some part of the application and/or infrastructure during the test, there was likely something wrong with the test you ran.

No comment yet.
Scoop.it!

Test driven development - the easy way!

Test driven development - the easy way! | JavaScript for Line of Business Applications | Scoop.it

A number of people, myself included, have a hard time getting started with test driven development (TDD). The issue lies in that it’s difficult to wrap your head around something that is rather non specific in its implementation and it is usually described as “writing your tests before you write your code”.

When developers hear “Write your tests before you write your code”, then they look at their previous test suite they wonder… “How can I possibly write this without having written the code first?

No comment yet.
Scoop.it!

Getting started with integration testing ember.js using ember-testing and qunit-rails

Ember-testing is a recent addition to the Ember.js framework that allows you to create integration tests for your app using a custom DSL for interacting with your async Ember.js app. We’re going to walk through how to write integration tests with ember-testing using the qunit-rails gem.

No comment yet.
Scoop.it!

Jasmine: A JavaScript Testing Framework

Jasmine: A JavaScript Testing Framework | JavaScript for Line of Business Applications | Scoop.it

I have been experimenting more with JavaScript frameworks lately. Being fond of the Test Driven Development methodology, I came across Jasmine. Here is how the site defines it: Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks. It does not require a DOM. And it has a clean, obvious syntax so that you can easily write tests.

No comment yet.
Scoop.it!

Unit Testing JavaScript with Venus.js

Unit Testing JavaScript with Venus.js | JavaScript for Line of Business Applications | Scoop.it

Venus.js in an open source software testing tool developed by LinkedIn that allows you to organize and run your entire JS testing system with a single tool using Node.js. Venus eliminates repetitive tasks and friction points and lets you focus on writing tests instead of running them.

No comment yet.
Scoop.it!

Test Driven Development with KnockoutJS, VisualStudio, and Karma: Binding to the View

Test Driven Development with KnockoutJS, VisualStudio, and Karma: Binding to the View | JavaScript for Line of Business Applications | Scoop.it

In our last post, we created a ViewModel which models the basic functionality we would like on the page. As a reminder, we have a Knockout “observable array” of items suitable for binding; each item is a JavaScript object containing a title and description in addition to a value called complete which indicates if this item has been completed. Our ViewModel function object accepts a parameter of any initial items we may need to load in to to our list from the server. We have a method called add_item which can add new items to our list, and we have a test suite that ensures that all of this is working. So far, all of this is inside a single file calledToDontListSpec.js.

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!

6 Examples of Hard to Test JavaScript

6 Examples of Hard to Test JavaScript | JavaScript for Line of Business Applications | Scoop.it

The following content comes from the second module of my Pluralsight course entitled: Front-End First: Testing and Prototyping JavaScript Apps. The rest of the course covers an introduction to Unit Testing,Mocha (a JavaScript test runner), Grunt (a JavaScript task runner),Sinon.js (a mocking and spying library), Mockjax (a way to mock Ajax requests), mockJSON (a way to generate semi-random complex objects for prototyping), and more.

No comment yet.
Scoop.it!

How Mocha Makes Testing Asynchronous JavaScript Processes Fun

How Mocha Makes Testing Asynchronous JavaScript Processes Fun | JavaScript for Line of Business Applications | Scoop.it
How Mocha Makes Testing Asynchronous JavaScript Processes Fun (How Mocha Makes Testing Asynchronous JavaScript Processes Fun: The Mocha Framework has simplified the testing ...
No comment yet.
Scoop.it!

Web Dev .NET: Angry Birds of JavaScript: Green Bird - Mocking

Web Dev .NET: Angry Birds of JavaScript: Green Bird - Mocking | JavaScript for Line of Business Applications | Scoop.it

We are going to take a look at a simple Twitter application that gets the tweets from a specific username. Why Twitter? Well, the Angry Birds have a special relationship with Twitter, especially the Blue Bird ;)

The following application grabs data from Twitter using JSONP. I thought about using Backbone.js to write the little application, but thought that might be overkill to introduce the mocking concept. You will also notice I am not using a templating engine and that is on purpose. Another Angry Bird will be introducing that concept ;)

No comment yet.
Scoop.it!

Pragmatic Unit Testing in JavaScript

Pragmatic Unit Testing in JavaScript | JavaScript for Line of Business Applications | Scoop.it

More often than not, companies completely (and irresponsibly) disregard JavaScript as code that should be unit tested. They might test their back-end code, it may be in C#, Ruby, Java, or even PHP, or just about any other language. But there's a good chance that the front-end code is thoroughly untested.

Integration level testing with tools such as Selenium is nice in theory, but way too impractical (you have to set up a server), and particularly slow (loading browsers and computing the recorded actions takes its toll). As such it's rarely part of build processes, and it's run manually (with a single command, but manually nonetheless).

So why is that JavaScript gets treated so differently from the rest of languages?

No comment yet.
Scoop.it!

Test driving an event driven design

Now with javascript we are back to the old techniques. There have been very few changes in software architecture and patterns in the last 20 years. We could have been writing web applications in the browser the way we do today, more than 10 years ago, if the big companies had agreed on standards and all that. It's always about people, not about software

Anyway, for those friends of mine that are already practicing TDD but haven't really used events, it is not clear how to test drive a collaboration between objects, using events.
Let's see the simplest way to publish and subscribe to an event using javascript:

No comment yet.