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: 'AngularJS', 'Jasmine'. Clear
Scoop.it!

Unit Testing w/ AngularJS

Unit testing is all about isolation and dependency injection makes isolation a breeze. Seasoned Java developers have known this for years. The Spring framework, ubiquitous in Java backends today, introduced dependency injection (or at least popularized it) and brought a great number of benefits in terms of decoupling, modularity, flexibility and testability. Simply put, dependency injection lets you swap out real implementations for mock ones and it damn near forces you to decouple every component.

No comment yet.
Scoop.it!

Testing AngularJS directive templates with Jasmine and Karma

Testing AngularJS directive templates with Jasmine and Karma | JavaScript for Line of Business Applications | Scoop.it

In my day job, I work on appear.in, a video chat service built with AngularJS and WebRTC. Recently, our application has become more complex, and our HTML templates ended up having a lot of state in them. We could no longer just use unit testing to verify our application logic, we also needed to test the state in our templates.

For our unit testing, we landed on using Jasmine and Karma, and this has worked fairly well for us. So when we wanted to test our templates, we wanted to use the same tools.

No comment yet.
Scoop.it!

Unit and End to End Testing in AngularJS

Unit and End to End Testing in AngularJS | JavaScript for Line of Business Applications | Scoop.it

Unit testing is a technique that helps developers validate isolated pieces of code. End to end testing (E2E) comes into play when you want to ascertain that a set of components, when integrated together, work as expected. AngularJS, being a modern JavaScript MVC framework, offers full support for unit tests and E2E tests. Writing tests while developing Angular apps can save you great deal of time which you would have otherwise wasted fixing unexpected bugs. This tutorial will explain how to incorporate unit tests and E2E tests in an Angular application. The tutorial assumes that you are familiar with AngularJS development. You should also be comfortable with different components that make up an Angular application.

We will use Jasmine as the testing framework and Karma as the test runner. You can use Yeoman to easily scaffold a project for you, or just quickly grab the angular seed app from GitHub.

No comment yet.
Scoop.it!

Angular/Jasmine Testing

Angular/Jasmine Testing | JavaScript for Line of Business Applications | Scoop.it

16) Angular/Jasmie, ngModelController and $parsers
A special episode by viewer request. How do you test $parsers, $formatters or otherwise in your Angular directives?

15) Angular/Jasmine, Inherited Directive Testing
Episode 15 in our Angular/Jasmine unit testing series. Testing directives that directly inherit from their parent (either directive or controller).

14) Angular/Jasmine, Inherited Controller Testing
Episode 14 in our series on Angular JS testing with Jasmine. Testing controllers that inherit $scope methods and properties from other controllers.

13) Angular/Jasmine, Testing Service Calls W/ Spies
Episode 13 in our Angular/Jasmine testing series. This episode shows how to setup service tests with spies.

12) Angular/Jasmine, Re-Tooling Configurations
Episode 12 of our Angular / Jasmine testing series. Re-tooling your Angular configuration for easier and more standardized testability.

11) Angular/Jasmine, Spying on Factories
Episode 11 in our Angular JS / Jasmine unit testing series. Using jasmine spies, specifically on Angular factories.

10) Angular/Jasmine, Testing Event Listeners
Episode 10 of our Angular JS Jasmine testing series. Testing event listeners in controllers and elsewhere. We welcome your feedback and requests.

9) Angular/Jasmine, Testing Watchers
Episode 9 of our Angular/Jasmine testing series. Testing scope watch methods in controllers and elsewhere. We are very thankful for your comments and requests.

8) Angular/Jasmine, Testing Directives W/ External Templates
Episode 8 in our Angular/Jasmine series. The configuration and testing approach for directives with external templates. Please leave feedback.

7) Angular/Jasmine, Directive Testing Part I
Episode 7 in our series on Angular/Jasmine testing. This is part I of testing directives. For more info on this, you should also check out: http://egghead.io/lessons/angularjs-unit-testin…

6) Angular/Jasmine, Filter Testing
Episode 6 in our Angular JS Jasmine unit testing series. This episode is about testing filters outside of the DOM.

5) Angular/Jasmine, Factory Testing
Episode 5 of our Angular Jasmine unit testing series. Testing factories and values.

3) Angular/Jasmine, Controller Testing
Episode 3 in our Angular Jasmine testing series. Testing controllers and methods on the $scope.

4) Angular/Jasmine, Controller Testing ('this' methods)
Episode 4 in our Angular Jasmine testing series. Testing instance methods on controllers, as supported by Angular 1.2.

2) Angular/Jasmine, Bower
Episode 2 in our Angular JS Jasmine unit testing series. Loading third party libraries with bower.

1) Angular/Jasmine, Setup
The first of our Angular Jasmine testing series. A video about how to setup your Angular testing environment.

No comment yet.
Scoop.it!

Advanced Testing and Debugging in AngularJS

Advanced Testing and Debugging in AngularJS | JavaScript for Line of Business Applications | Scoop.it
Learn to test, debug and prepare the test code on your AngularJS application like a Pro using Jasmine unit testing and Protractor integration testing

AngularJS is becoming immensely popular and mainstream which means that there is a lot of AngularJS code out there that is being tested or is yet to be tested. And now that you're well on your way to test like a pro, thanks to the abundance of articles, tutorials, books and material out there on AngularJS testing & development, testing should be a mandatory process of your web development workflow.

Full-Spectrum testing with AngularJS & Karma taught us how to test certain areas of your AngularJS application, but how do we test efficiently? How do we debug a problem down the root cause? How do we skip tests, set breakpoints, and professionally mock-out our test components so that we can catch hidden bugs and unexpected scenarios? How far can and should we go with Unit & E2E testing? What else should we consider. Well lets take adeeper dive into testing in AngularJS and expand our minds by learning how to become a professional front-end tester.

Table of Contents:
* Presentation Slides + Video
* What to test and what not to test
* Preparing your test environment with Karma & Grunt
* Write tests as you go
* So when do you do your testing?
* Module & Inject Breakdown
* Powerful Mocking Strategies
* Sync' and Async' testing
* Skipping and Filtering tests
* Echoing data back to screen
* Using Breakpoints
* Writing Efficient Tests
* Testing older browsers
* Invest into preparing a CI environment
* Feedback Please!

No comment yet.
Scoop.it!

introduction to unit test for AngularJS

introduction to unit test for AngularJS | JavaScript for Line of Business Applications | Scoop.it

Jasmine is like writing English. It is something easy to read and understand (which is waay cool). Jasmine spec files are normally wrapped on a describe block which receives a string to define what are we describing. They are used to group tests. We can see how we have another describe block which is nested in the previous one with the addition as parameter. See how are we grouping the tests?

No comment yet.
Scoop.it!

Walkthrough: Killing Bugs in AngularJS with Karma & Jasmine

Walkthrough: Killing Bugs in AngularJS with Karma & Jasmine | JavaScript for Line of Business Applications | Scoop.it
Follow along in this two part series as we walk through the steps to test for bugs in AngularJS.

First, we will write unit tests that reflect the intended behavior and then fix the bug so these tests pass. The goal is to improve code maintainability and reduce regression bugs.Download or clone the repo to follow along – each step has a corresponding branch to checkout.

We are going to focus on the play/pause functionality of the player. By right-clicking on the video element, we can see that the video will play and pause.

We will write tests for both the controller and the directive for this button in order to make sure our tests are small, consistent and maintainable.

No comment yet.
Scoop.it!

How to Unit Test Controllers In AngularJS Without Setting Your Hair On Fire

How to Unit Test Controllers In AngularJS Without Setting Your Hair On Fire | JavaScript for Line of Business Applications | Scoop.it
Developers almost universally agree that unit tests are a VERY GOOD THING when working on a project. They help you feel like your code is airtight, ensure reliability in production, and let you refactor with confidence when there is a need to do so.

AngularJS code touts its high degree of testability, which is a reasonable claim. In much of the documentation end to end tests are provided with the examples. Like so many things with Angular, however, I was finding that although unit testing was simple, it was not easy. Examples were sparse and though the official documentation provided some snippets of examples, putting it all together in my “real-world” case was proving challenging. So here I’ve written a little bit about how I ended up getting that wonderful green light for a passing build to show up.

* Instant Karma

* Writing Tests With Jasmine

* $httpBackend Is Cool

* Conclusion

No comment yet.
Scoop.it!

AngularJs Good Unit Test Structure For Controllers & How to test ajax code and Promises

AngularJs Good Unit Test Structure For Controllers & How to test ajax code and Promises | JavaScript for Line of Business Applications | Scoop.it

The poorly the structure is made for unit testing the more and more complected it will take to write a unit test for a simple functioning piece of code , and it will feel that your fighting your way against testing, instead it should feel more fun! So i’ll be showing a structure that worked for me very well when working with angular controllers Before going deep with the structure, i’ll be using

* Jasmine (unit testing)

* Jasmine spies (mocking)

* karma (because its awesome)

No comment yet.