Book Image

Meteor Design Patterns

By : Reyna
Book Image

Meteor Design Patterns

By: Reyna

Overview of this book

With the increasing interest in NodeJS web applications, a new framework, Meteor, has joined the ranks to simplify developer workflows. Meteor is one of the few open source frameworks that has received funding since its early development stages. It builds on ideas from existing frameworks and libraries, offering developers an easy way to develop a prototype app. At the same time, it gives them the tools and flexibility to build a fully fledged production app. Meteor is the weapon of choice for start-ups in today’s world. Meteor Design Patterns cuts through the jargon that most websites play with and gets to the point with simple solutions that will boost your development skills. We start off with a refresher on the basics of JavaScript programming such as templates, CoffeeScript, the Event Loop, and the Merge Box, amongst others. You then learn how to map real-world data and optimize the data’s publishers to output data with the least amount of work done by the server with some subscribe and publish patterns. Next, using front-end patterns, you will learn how to create maintainable and trackable forms, and make our site crawlable by any search engine. Following this, you will see how to optimize and secure the web application and maintain applications without breaking other features. Finally, you will learn how to deploy a secure production-ready application while learning to set up modulus, compose with Oplog tracking and SSL certificates, as well as error tracking with Kadira. Throughout the book, you will put your skills to practice and build an online shop from scratch. By the end of the book, you will have built a feature-rich online shop.
Table of Contents (8 chapters)

Behavior tests

Behavior tests are known as end-to-end tests too. The purpose of a behavior test is simple: it makes sure that a feature of the project is working. A feature refers to the business logic behind the application. For example, a feature of our current project is viewing a list of products in our landing page. Another feature is the ability to add a variable quantity of products to the order.

To run behavior tests in Meteor, we essentially need to build a robot that can visit our website and try to make these features work. While this sounds complex, the Meteor Velocity project simplifies much of this when paired with Cucumber.

Velocity is a project that sets the stage for other testing frameworks to use. It works by creating mirrors of the project where tests can run.

Cucumber is a specification-by-example testing framework. It is meant to describe application features in plain English before they are programmed. In a collaboration setting, these tests are the ones that matter...