JavaScript for Line of Business Applications
596.1K views | +1 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!

Measuring Client-Side JavaScript Test Coverage With Istanbul

Measuring Client-Side JavaScript Test Coverage With Istanbul | JavaScript for Line of Business Applications | Scoop.it

Use Istanbul to get an in-depth look at what you currently are and aren't testing in your JavaScript app.

Rather than using test coverage as a measure of developer thoroughness, it makes a lot more sense to use coverage as a way of seeing which code isn't covered (hint: it's often else branches). That information can then be used to prioritize testing goals.

In summary: don't use code coverage to measure what's tested, use it to find out what isn't.

No comment yet.
Scoop.it!

Unit Testing in Sails.js with Mockgoose, Mocha and Chai

Unit Testing in Sails.js with Mockgoose, Mocha and Chai | JavaScript for Line of Business Applications | Scoop.it

I obviously chose Sails.js, I decided to use Angular because I wanted to learn it, and I used Mongo because I wanted to work with a NoSQL db (for no other reason than to learn it). This kept my stack completely Javascript, and really fun to learn. When it came time to write my models I decided to use Mongoose instead of Waterline, which involved some fun little hacks here and there to get it wired up inside of Sails. However, the real challenge came when I decided to start doing Unit Testing and TDD, and that's what I'll go in to (finally, right?). For the sake of clarity I'm going to focus on how I got Mockgoose to work with my tests 

No comment yet.
Scoop.it!

ember-cli-mocha: Mocha and Chai tests for ember-cli applications

ember-cli-mocha: Mocha and Chai tests for ember-cli applications | JavaScript for Line of Business Applications | Scoop.it

ember-cli-mocha overrides all of ember-cli's testing blueprints. Simply generate models, controllers, components, etc. in order to generate the corresponding Mocha / Chai tests.

Tests rely on ember-mocha modules and helpers. Please refer to that project to understand detailed usage.

No comment yet.
Scoop.it!

Testing and code coverage using grunt-mocha-istanbul in Sails js

Testing and code coverage using grunt-mocha-istanbul in Sails js | JavaScript for Line of Business Applications | Scoop.it

In this post, I will be showing how to write tests for sails js apps (version >= 0.10.4).

No comment yet.
Scoop.it!

Unit Testing Sails.js Applications With Mocha

Unit Testing Sails.js Applications With Mocha | JavaScript for Line of Business Applications | Scoop.it

As it turns out, getting tests in place for Sails was one of the easier things I've done in my life and I was able to get a few unit tests running withing 30 minutes of sitting down to do it.

No comment yet.
Scoop.it!

Writing Unit Tests for Existing JavaScript

Writing Unit Tests for Existing JavaScript | JavaScript for Line of Business Applications | Scoop.it

Our unit tests are organized into suites. Each suite consists of a number of files, each of which tests a single AMD module. Most of the modules under test when I started down this path were pretty isolated – they didn’t have a ton of dependencies generally, and had very few runtime dependencies. They didn’t interact with other modules that much. Almost all of the existing unit test files loaded a module, executed its methods, and inspected the return value. No big deal.

Feature-related code – especially already-written feature-related code – is a different story. Views have templates. Models expect data. Models pass information to views, and views pass information to models. Some models need parents; others expect children. And pretty much everything depended on a global-ish message broker to pass information around.

No comment yet.
Scoop.it!

Stop Making Excuses and Start Testing Your JavaScript

Talk from HTML5DevConf about JavaScript unit testing.
No comment yet.
Scoop.it!

Unit test SailsJS with Mocha and generate code coverage with Istanbul

Unit test SailsJS with Mocha and generate code coverage with Istanbul | JavaScript for Line of Business Applications | Scoop.it

Unit testing JavaScript is easy they said. It only takes a few seconds they said.

And they were right for the most part! Well, maybe seconds is an exaggeration but we can definitely achieve this with very few minutes

So you fired up your first hello world app using SailsJS, it was super simple and you started wondering if testing your app would be as simple. Soon after you realized this was not the case and much like everything else related to testing in JavaScript there is not just one right answer.

Perhaps you may have much more experience with SailsJS and have way gone beyond the hello world phase and now is time to make sure your application is reliable. Unit testing is part of the solution when it comes to code reliability.

No comment yet.
Scoop.it!

Which JavaScript Test Library Should You Use? QUnit vs Jasmine vs Mocha

Which JavaScript Test Library Should You Use? QUnit vs Jasmine vs Mocha | JavaScript for Line of Business Applications | Scoop.it

Whether you’re writing javaScript for the browser or for nodeJS, the question exists: what unit test library should I use to ensure my javascript code is working as expected?  There are plenty to choose from, and several that are popular.  If you were considering jUnit, Jasmine, or Mocha, then I’ve got some information you might be interested in: the good, the bad, and the ugly.

Arik Grinstein's curator insight, May 16, 2014 9:29 AM

Testing the Tests

Scoop.it!

Testium: integration test platform for Node.js using mocha and a sync api

Testium: integration test platform for Node.js using mocha and a sync api | JavaScript for Line of Business Applications | Scoop.it

With testium you can write integration tests that:
* use a familiar BDD syntax
* are written in CoffeeScript/JavaScript
* have a synchronous API
* can leverage Selenium

Why Create a New Tool?
Since the beginning of our transition to Node.js, we have been looking for a great way to include integration testing in our Node.js applications. In Ruby on Rails, we had a Cucumber setup that could run tests in real browsers via Selenium. The relationship with testing tools was not strongly defined for Node.js (the platform) or even Express (the underlying framework).
That lead us to look for other existing tools we could adopt. We tried a couple of tools, but they just didn’t fit our needs for different reasons.

No comment yet.
Scoop.it!

Testing your frontend JavaScript code using mocha, chai, and sinon

Testing your frontend JavaScript code using mocha, chai, and sinon | JavaScript for Line of Business Applications | Scoop.it

For the 4 past months, I've been working for Mozilla on some big project where such testing strategy was involved. While I wish we could use CasperJSin this perspective, Firefox wasn't supported at the time and we needed to ensure proper compatibility with its JavaScript engine. So we went with usingMocha, Chai and Sinon and they have proven to be a great workflow for us so far.

Mocha is a test framework while Chai is an expectation one. Let's say Mocha setups and describes test suites and Chai provides convenient helpers to perform all kinds of assertions against your JavaScript code.

No comment yet.
Scoop.it!

konacha - Test your Rails application's JavaScript with mocha and chai

konacha - Test your Rails application's JavaScript with mocha and chai | JavaScript for Line of Business Applications | Scoop.it

konacha - Test your Rails application's JavaScript with the mocha test framework and chai assertion library.

It is similar to Jasmine and Evergreen, but does not attempt to be framework agnostic. By sticking with Rails, Konacha can take full advantage of features such as the asset pipeline and engines.

No comment yet.
Scoop.it!

Yadda, WebdriverJS, Mocha: A BDD test framework using JavaScript

Yadda, WebdriverJS, Mocha: A BDD test framework using JavaScript | JavaScript for Line of Business Applications | Scoop.it

As part of Shazam’s BDD process, the Web team decided to start including automated acceptance test writing during the development process, with each developer in the team writing their own acceptance tests.


As we’re a team of both front and back end developers, it was important to find a language that we all felt confident using. JavaScript was an obvious choice for this. We then had the challenge of finding a framework that incorporated BDD feature files written in natural language with automated tests written in JavaScript. After trying out a couple of different options, we finally settled on a stack using Yadda for our feature files and parsing, withWebdriverJS for browser automation, and Mocha for test wire-up. The decision to use these libraries came after some trial-and-error, and we had variety of reasons for choosing these particular components for our new automation framework.

No comment yet.
Scoop.it!

A Journey Through Client-Side Testing with JavaScript

A Journey Through Client-Side Testing with JavaScript | JavaScript for Line of Business Applications | Scoop.it

Having tests is important. They allow us to extend and refactor our code with ease. Many developers follow test driven development as a workflow. I believe that writing tests makes software development much more interesting and generally leads to better code. Well-designed and tested systems are easier to maintain.

No comment yet.
Scoop.it!

Unit test your client-side JavaScript

Unit test your client-side JavaScript | JavaScript for Line of Business Applications | Scoop.it

I don't think that we have to discuss the importance of having tests. That's not something that we add to the project in addition. That's something that the project is based on. And because testing is so important we have bunch of tools in our disposal. We all know (I hope) how to test our back-end code. However, once we move to the front-end is a bit different. At the moment we are working on a big single page application and testing is one of our main focuses. In this article you will see how to unit test our client-side JavaScript.

No comment yet.
Scoop.it!

An Introduction To Unit Testing In AngularJS Applications

An Introduction To Unit Testing In AngularJS Applications | JavaScript for Line of Business Applications | Scoop.it

One of the reasons for AngularJS’ success is its outstanding ability to be tested. It’s strongly supported by Karma (the spectacular test runner written by Vojta Jína) and its multiple plugins. Karma, combined with its fellows MochaChai and Sinon, offers a complete toolset to produce quality code that is easy to maintain, bug-free and well documented.

Tests must define the code’s API. This is the one principle that will guide us through this journey. An AngularJS application is, by definition, composed of modules. The elementary bricks are materialized by different concepts related to the granularity at which you look at them. At the application level, these bricks are AngularJS’ modules. 

No comment yet.
Scoop.it!

Jest vs. Mocha: Why Jest Wins

Jest vs. Mocha: Why Jest Wins | JavaScript for Line of Business Applications | Scoop.it

When developing front-end applications, my TDD tool belt consists of karma, mocha, sinon, and chai. When I first learned of Jest, I was skeptical of the new JavaScript unit testing framework and was not convinced I should make the switch. After a bit of research and a sample project on Github, I will tell you why I have made the decision to switch and why you should, too. ...

No comment yet.
Scoop.it!

AngularJS Unit Testing - For Real, Though

AngularJS Unit Testing - For Real, Though | JavaScript for Line of Business Applications | Scoop.it

This article is written for intermediate to advanced developers using AngularJS to build production applications, who would like to reduce some of the pain of testing. It is my hope that feeling secure in testing workflow will enable the reader to practice a TDD workflow and build a more solid app.

No comment yet.
Scoop.it!

Express.js 4, Node.js and MongoDB REST API Tutorial

Express.js 4, Node.js and MongoDB REST API Tutorial | JavaScript for Line of Business Applications | Scoop.it

ere’s a brand new, revisited tutorial for Express.js 4, Node.js and MongoDB (Mongoskin) free-JSON RESTful API server.

Contents:

  • Node.js and MongoDB REST API Overview
  • REST API Tests with Mocha and Superagent
  • NPM-ing Node.js Server Dependencies
  • Express.js 4.x Middleware Caveat
  • Express.js and MongoDB (Mongoskin) Implementation
  • Running The Express.js 4 App and Testing MongoDB Data with Mocha
  • Conclusion and Further Express.js and Node.js Reading

This Node.js, Express.js and MongoDB (Mongoskin) tutorial will walk you through writing the test using the Mocha and Super Agent libraries. This is needed for a test-driven development building of a Node.js free JSON REST API server.

The server application itself will utilize Express.js 4.x framework and Mongoskin library for MongoDB. In this REST API server, we’ll perform create, read, update and delete (CRUD) operations and harness Express.js middleware concept with app.param() and app.use() methods.

No comment yet.
Scoop.it!

react-gulp-example

react-gulp-example | JavaScript for Line of Business Applications | Scoop.it

a simple react web app using gulp along side karma/mocha/chai

No comment yet.
Scoop.it!

Node.js Handbook - Testing Essentials

Node.js Handbook - Testing Essentials | JavaScript for Line of Business Applications | Scoop.it

This post will explain the tools needed to overcome the challenges of testing with Node.js. Together, they form an essential testing suite that will cover almost any project. The setup isn’t the most complex or feature-rich, but you could say that’s on purpose. If that sounds counter-intuitive… read on.

  • A Testing Framework (Mocha, Vows, Intern)
  • An Assertion Library (Chai, Assert)
  • Stubs (Sinon)
  • Module Control (Mockery, Rewire)
No comment yet.
Scoop.it!

Test-Driven Development of Ember.js Applications

In this session, I will present a walkthrough of Ember.js core features. I will showcase a test-driven development of Ember.js application using Jasmine. I will also explain Ember.js' data bindings that allow for creation of views that update automatically in response to model changes. I will demo ease of Ember.js and Rails integration. Finally, I will utilize Ember.js components to create reusable UI elements.

Jan Hesse's insight:

Slides:

https://speakerdeck.com/antityping/test-driven-ember-dot-js

Code:

https://github.com/AntiTyping/EmberDo

No comment yet.
Scoop.it!

Get your Frontend JavaScript Code Covered

Get your Frontend JavaScript Code Covered | JavaScript for Line of Business Applications | Scoop.it

So finally you're testing your frontend JavaScript code? Great! The more you write tests, the more confident you are with your code… but how much precisely? That's where code coverage might help.

The idea behind code coverage is to record which parts of your code (functions, statements, conditionals and so on) have been executed by your test suite, to compute metrics out of these data and usually to provide tools for navigating and inspecting them.

Not a lot of frontend developers I know actually test their frontend code, and I can barely imagine how many of them have ever setup code coverage… Mostly because there are not many frontend-oriented tools in this area I guess.

Actually I've only found one which provides an adapter for Mocha and actually works…

No comment yet.
Scoop.it!

Code Coverage of Mocha Tests using Istanbul and Karma

Code Coverage of Mocha Tests using Istanbul and Karma | JavaScript for Line of Business Applications | Scoop.it

Many JavaScript projects are using Mocha to run the unit tests. Combining Mocha with Istanbul andKarma, it is easy to track the code coverage of the application code when running the tests.

While Mocha has a built-in support for running the tests from the command-line via Node.js, in some cases you still want to verify your code with the real web browsers. The easiest way to do that with by using Karma to automatically launch the browsers, control them, and execute the tests. 

No comment yet.
Scoop.it!

Testing Ember.js applications with Konacha.

Testing Ember.js applications with Konacha. | JavaScript for Line of Business Applications | Scoop.it

his time I want to show you how to write tests for your Ember.js application, using the Konacha gem.

Basically, Konacha is a Rails engine which allows us to test the Javascript code from our Rails application with the Mochatest framework and Chai assertion library.

This post is focused on Ember.js + Rails web applications.

* Setup
* Running specs
* Spec Helper
* DSL
* More customization
* Testing Routes
* Testing Controllers
* Integration Tests
* Filtering the tests

ali's curator insight, November 28, 2013 12:54 AM

Sears Promo Codes - Latest Sears Promotional & Discount Codes 2013

http://www.stumbleupon.com/su/9TEAsm/promocodeshop.com/Sears/