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 tag: 'Mocha'. Clear
Scoop.it!

Unit Testing Ember Data Models

Ember.js is a JavaScript MVC framework for creating ambitious web applications and is one that, along with the Ember Data library's models, SoftLayer uses for its projects. The "M" in MVC stands for model which is the most important layer in an application, for if the data models are not correctly architected anything built on top of them will inherit their deficiencies. While this post is not going to discuss how to architect your data models in Ember.js it is going to propose a way in which you can Unit Test your model's definitions so that you keep any incongruent changes from being introduced into them.

When we write our Unit Tests we want them to be able to completely test the definition of our data models. This includes properties, their type, any relationships they have with other data models, the generated result of any computed properties and the properties computed properties are observing. 

No comment yet.
Scoop.it!

Testable & Tested Client-side Code

Testable & Tested Client-side Code | JavaScript for Line of Business Applications | Scoop.it

Testing (i.e. linting, unit tests, integration testing etc..) client-side code is not done as commonly as it should be. The reason it is so commonly not done, besides lack of know-how, is that it is presupposed that it will take time away from other more productive development tasks.

This fallacious notion is, of course, wrong. The repeatable successes in software engineering based on testable (i.e. modular, loosely coupled, small, simple units of code) and tested code has proven again and again to be a time-saver and part of creating maintainable and understandable code. At a minimum, if code is not unit tested it is only a matter of time before it is burnt down and re-written, or abandoned altogether because it becomes unmaintainable and incomprehensible.

In this article, I am going to defend and talk about testing client-side code. It is my intention that the information in this article will give those among us who do not test, the desire and some initial testing knowledge to test, along with the ability to defend its necessity from any agent that might deter testing.

No comment yet.
Scoop.it!

Meet TextUml – A Real-time Application Developed with Signalr and Backbone.js

Meet TextUml – A Real-time Application Developed with Signalr and Backbone.js | JavaScript for Line of Business Applications | Scoop.it

It is still in very early stage and in terms of features it draws uml sequence diagram from your input and you can share the document with multiple users who can participate in collaborative editing.

Behind the scene TextUml is developed with Backbone.js in CoffeeScript, it uses Require.js for modularization, KineticJS for html5 canvas drawing,  Mocha, Chai and Sinon for client side testing. The server side uses all the latest beta of ASP.NET MVC, ASP.NET WebAPI and Signalr. 

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!

Modern Ember.js Application Workflow with Yeoman and Mocha

Modern Ember.js Application Workflow with Yeoman and Mocha | JavaScript for Line of Business Applications | Scoop.it

The following tutorial will provide an overview for building Ember.js applications with Yeoman. Keep in mind, Yeoman is a framework agnostic collection of tools, used to manage the workflow of any JavaScript application or plugin. For the sake of this tutorial, we have chosen to focus on Ember.js, as a case study.

Our workflow would not be complete without also setting up our testing strategy, so we will also include a standard BDD (Behavior Driven Development) setup with the Mocha testing framework.

No comment yet.
Scoop.it!

BrowserStig = Developer Friendly Browser Automation

BrowserStig = Developer Friendly Browser Automation | JavaScript for Line of Business Applications | Scoop.it

Although BrowserStig may be used for other automation purposes, it's main purpose is to be used for functional testing. As mentioned before, you can use browserstig.js standalone without the cli. This would allow you to import browserstig.js into any javascript testing framework. However, the stig cli is designed to help you start testing immediately with minimal setup.

If you have used the karma test runner, you will be familiar with the stig cli. Really, the stig cli just wraps the karma test runner. The supported test styles are 'mocha', 'jasmine' and 'qunit'. However, this documentation only covers testing with mocha.

No comment yet.
Scoop.it!

Incredibly convenient testing of front-end Javascript with Node.js

Incredibly convenient testing of front-end Javascript with Node.js | JavaScript for Line of Business Applications | Scoop.it

You do have automated testing for your front-end Javascript application / library / framework don’t you? And tests work equally well at console, browsers and Travis aren’t they? And you run them in every possible browser on each release (or even push) right? If the answer is no, you might be doing it wrong. Let’s see if we can do something about it!

This article briefly describes a little piece of theory behind testing of standalone front-end projects, issues that you are likely to meet and the solution I came up with.

When it comes to testing, the first question is — which framework are we going to use? There are numerous articles on the Internet that describe pros and cons of those.

I personally prefer Jasmine and Mocha (coupled with CoffeeScript and Chai they feel so much like RSpec). But it’s only a matter of taste in fact. Their capabilities are more or less equal.

Let’s say we have a framework. Then we can manually create HTML file, include JS we want to test, open it in a browser and, well, test. It’s certainly a kind of automatic testing already but still so far away from something reasonable. And the first thing to think about is Continuous Integration. You can only run such tests manually and see the results with your eyes. No “on-commit runs”, no Travis integration. Sadness.


No comment yet.
Scoop.it!

Javascript, Backbone, Require, TDD

https://github.com/EduardoDiaz/backbone-mocha-requirejs
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.