background preloader

Testing Tools

Facebook Twitter

AngularJS-SEO-Article/test/lib/mocha at master · yearofmoo-articles/AngularJS-SEO-Article. Kochiku: CI for long test suites. September 06, 2013 Back in the summer of 2011, every request to Square’s servers went through a single monolithic Rails application we lovingly call SquareWeb.

Kochiku: CI for long test suites

At the time, SquareWeb had hundreds of models and controllers, all with tests to cover their behavior. In addition to the many unit tests written with RSpec, we had hundreds of acceptance tests written with Cucumber—some of which used Selenium to open a web browser and step through long flows. Due to its size, the SquareWeb test suite took between two and three hours to run on CI. If a single flaky test failed, we retried the entire build, waiting hours more. We know Rails tests don't have to be slow (at least not the unit tests); Corey Haines has done a great job of publicizing methods for removing the Rails framework from the flow of a test so that only the business logic runs. In July of 2011, we started working on a test system that would automatically partition our build into distributable chunks. The future of Kochiku. CoffeeScript tests for Rails apps - Arkency Blog. You may know this pain too well - you've created rich client-side in you Rails app and when your try to test CoffeeScript features it consumes much time to run all test scenarios with capybara and any of browser drivers (selenium, webkit, phantomjs).

CoffeeScript tests for Rails apps - Arkency Blog

Let's apply painkiller then - move responsibility of testing front-end to… front-end. This is just a beginning of series about testing CoffeeScript in Rails stack, so if you're familiar with basics - you know toolset and you know how to test your models - don't waste your time. In next post I'll show how to extract existing views and write unit tests for them. Next I want to cover acceptance tests topic. If you're interested just subscribe with RSS or mailing list. Tools. Ruby5 - Getting started with Konacha. Jfirebaugh/konacha. Speeding Up the Konacha JavaScript Testing Framework with Views - Intensive Code Unit. Konacha can only run as fast as Rails can serve it.

Speeding Up the Konacha JavaScript Testing Framework with Views - Intensive Code Unit

Konacaha’s readme suggests including the JavaScript you need to run your tests in a JavaScript spec helper, but this can result in excessively expensive asset compilation. Replacing Konacha’s iframe view with your own implementation can yield a substantial improvement in execution time for a large test suite. Moving to Konacha Recently the Iora engineering team decided to start using Konacha as our JavaScript test runner after a few of us had started using Konacha in extra-curricular projects and fallen in love with Mocha, Chai, and the bustling Chai ecosystem. Home - Chai. Mocha Testing AngularJs Dependency Injection - Jake Trent. When you test your AngularJs code, you need to explicitly inject the services that your controllers and modules require.

Mocha Testing AngularJs Dependency Injection - Jake Trent

It has its own special syntax. It requires mocking. You’ll see a slightly different syntax than you may have expected. The Solution: Mocking AngularJs Injections Angular is simple and quick on many things. Because we started using dependency injection and our controller has dependencies, constructing the controller in our tests is a bit more complicated. And really, who doesn’t use dependency injection in any of their Angular code? The final Mocha code to test our simple controller should look something like this: A couple of points: Expect / Should - Chai. Asserts that the target has a property name, optionally asserting that the value of that property is strictly equal to value.

Expect / Should - Chai

If the deep flag is set, you can use dot- and bracket-notation for deep references into objects and arrays. You can also use an array as the starting point of a deep.property assertion, or traverse nested arrays. Furthermore, property changes the subject of the assertion to be the value of that property from the original object. This permits for further chainable assertions on that property. Testing JavaScript/CoffeeScript with Mocha and Chai. Testing JavaScript/CoffeeScript with Mocha and Chai. Testdouble/lineman. How Mocha Makes Testing Asynchronous JavaScript Processes Fun. I recently wrote an article entitled Test Asynchronous Methods Using the Jasmine runs() and waitFor() Methods.

How Mocha Makes Testing Asynchronous JavaScript Processes Fun

In it, I presented how Jasmine's runs() and waitsfor() methods are utilized in the testing of asynchronous processes. I'm a big fan of Jasmine because of its ease of use and and overall awesomeness. Nonetheless, it isn't perfect. I have heard rumblings about how convoluted the code can become when dealing with successive asynchronous calls. On the same subject, I've also heard how the Mocha Framework has simplified the testing of asynchronous methods. Pain Before the Gain In the music business, we have an expression called "paying your dues". Modeset/teaspoon. Chrome Devtools Cheatsheet.

Opening Devtools ◊ To access the DevTools, on any web page or app in Google Chrome you can use one of these options: Open the Chrome menu at the top-right of your browser window, then select Tools > Developer Tools.

Chrome Devtools Cheatsheet

Right-click on any page element and select Inspect Element. To open up the General Settings dialog type ? Or F1 when the Developer Tools window is open. All Panels Elements Panel ◊ Right-clicking an element you can: Force element psuedo states: (:active, :hover, :focus, :visited) Set breakpoints on the elements: (Subtree modifications, Attribute modification, Node removal) Clear console Styles Sidebar ◊ Emulate an element's pseudo state (:active, :hover, :focus, :visited) Add new style selectors Network Panel ◊

Taming Serpents and Pachyderms. Nearly two years ago, I was considering which Python web framework to use for a user interface to Postgres: CherryPy, Flask, Werkzeug?

Taming Serpents and Pachyderms

Not entirely satisfied with the choices, I started reviewing even more frameworks thinking I might want to write my own minimalist framework. Several months later, somebody (through Planet Python, IIRC) referred me to a presentation by Jacob Kaplan-Moss on the history and future of Python on the web. Surprisingly, halfway through the talk Jacob started raving about Meteor, a pure JavaScript framework, saying “we’re deluding ourselves if we think this [something like Meteor] is not the future of web applications.” This prompted me to take a close look at Meteor and several other JS frameworks. Tarek Ziadé’s “A new development era” essay reinforced this change in direction.

Angular opened the door to the Node.js world—which appears somewhat chaotic compared to Python’s (and even more to the staidness of Postgres). Introducing the AngularJS Batarang. Treasonx/amd-karma-example. Testing Angular.js. As an Angular.js developer, I want to test my code, so that I can feel reasonably good about it.

Testing Angular.js

This sounds like a "User Story" in Scrum but it's more of a developer quest. So in this blog we will look at ways to test our Angular.js code. Never Hit Reload Again. Imagine a nice world where you have a dual monitor setup for web development.

Never Hit Reload Again

Testdouble/lineman. Sarath2/lineman-angular-template. Include twitter-boostrap and jquery · Issue #5 · davemo/lineman-angular-template. Say Hello to Lineman. Davemo/lineman-angular-template. Fingertips/Peck-On-Rails.